Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
0b159b34
Unverified
Commit
0b159b34
authored
Mar 16, 2023
by
Binbin
Committed by
GitHub
Mar 16, 2023
Browse files
Bump codespell to 2.2.4, fix typos and outupdated comments (#11911)
Fix some seen typos and wrong comments.
parent
f8a5a4f7
Changes
12
Hide whitespace changes
Inline
Side-by-side
.codespell/requirements.txt
View file @
0b159b34
codespell==2.2.
2
codespell==2.2.
4
redis.conf
View file @
0b159b34
...
@@ -1972,7 +1972,7 @@ zset-max-listpack-entries 128
...
@@ -1972,7 +1972,7 @@ zset-max-listpack-entries 128
zset
-
max
-
listpack
-
value
64
zset
-
max
-
listpack
-
value
64
# HyperLogLog sparse representation bytes limit. The limit includes the
# HyperLogLog sparse representation bytes limit. The limit includes the
# 16 bytes header. When a
n
HyperLogLog using the sparse representation crosses
# 16 bytes header. When a HyperLogLog using the sparse representation crosses
# this limit, it is converted into the dense representation.
# this limit, it is converted into the dense representation.
#
#
# A value greater than 16000 is totally useless, since at that point the
# A value greater than 16000 is totally useless, since at that point the
...
...
src/blocked.c
View file @
0b159b34
...
@@ -612,7 +612,6 @@ void blockPostponeClient(client *c) {
...
@@ -612,7 +612,6 @@ void blockPostponeClient(client *c) {
/* Block client due to shutdown command */
/* Block client due to shutdown command */
void
blockClientShutdown
(
client
*
c
)
{
void
blockClientShutdown
(
client
*
c
)
{
blockClient
(
c
,
BLOCKED_SHUTDOWN
);
blockClient
(
c
,
BLOCKED_SHUTDOWN
);
/* Mark this client to execute its command */
}
}
/* Unblock a client once a specific key became available for it.
/* Unblock a client once a specific key became available for it.
...
...
src/hyperloglog.c
View file @
0b159b34
...
@@ -144,7 +144,7 @@
...
@@ -144,7 +144,7 @@
* In the example the sparse representation used just 7 bytes instead
* In the example the sparse representation used just 7 bytes instead
* of 12k in order to represent the HLL registers. In general for low
* of 12k in order to represent the HLL registers. In general for low
* cardinality there is a big win in terms of space efficiency, traded
* cardinality there is a big win in terms of space efficiency, traded
* with CPU time since the sparse representation is slower to access
:
* with CPU time since the sparse representation is slower to access
.
*
*
* The following table shows average cardinality vs bytes used, 100
* The following table shows average cardinality vs bytes used, 100
* samples per cardinality (when the set was not representable because
* samples per cardinality (when the set was not representable because
...
...
src/listpack.c
View file @
0b159b34
...
@@ -732,7 +732,7 @@ unsigned char *lpFind(unsigned char *lp, unsigned char *p, unsigned char *s,
...
@@ -732,7 +732,7 @@ unsigned char *lpFind(unsigned char *lp, unsigned char *p, unsigned char *s,
/* Skip entry */
/* Skip entry */
skipcnt
--
;
skipcnt
--
;
/* Move to next entry, avoid use `lpNext` due to `
ASSERT_INTEGRITY
` in
/* Move to next entry, avoid use `lpNext` due to `
lpAssertValidEntry
` in
* `lpNext` will call `lpBytes`, will cause performance degradation */
* `lpNext` will call `lpBytes`, will cause performance degradation */
p
=
lpSkip
(
p
);
p
=
lpSkip
(
p
);
}
}
...
...
src/networking.c
View file @
0b159b34
...
@@ -2458,7 +2458,7 @@ int processPendingCommandAndInputBuffer(client *c) {
...
@@ -2458,7 +2458,7 @@ int processPendingCommandAndInputBuffer(client *c) {
/* Now process client if it has more data in it's buffer.
/* Now process client if it has more data in it's buffer.
*
*
* Note: when a master client steps into this function,
* Note: when a master client steps into this function,
* it can always satisfy this condition, because its querbuf
* it can always satisfy this condition, because its quer
y
buf
* contains data not applied. */
* contains data not applied. */
if
(
c
->
querybuf
&&
sdslen
(
c
->
querybuf
)
>
0
)
{
if
(
c
->
querybuf
&&
sdslen
(
c
->
querybuf
)
>
0
)
{
return
processInputBuffer
(
c
);
return
processInputBuffer
(
c
);
...
@@ -4071,7 +4071,7 @@ static inline void setIOPendingCount(int i, unsigned long count) {
...
@@ -4071,7 +4071,7 @@ static inline void setIOPendingCount(int i, unsigned long count) {
}
}
void
*
IOThreadMain
(
void
*
myid
)
{
void
*
IOThreadMain
(
void
*
myid
)
{
/* The ID is the thread number (from 0 to server.iothreads_num-1), and is
/* The ID is the thread number (from 0 to server.io
_
threads_num-1), and is
* used by the thread to just manipulate a single sub-array of clients. */
* used by the thread to just manipulate a single sub-array of clients. */
long
id
=
(
unsigned
long
)
myid
;
long
id
=
(
unsigned
long
)
myid
;
char
thdname
[
16
];
char
thdname
[
16
];
...
...
src/script.c
View file @
0b159b34
...
@@ -160,7 +160,7 @@ int scriptPrepareForRun(scriptRunCtx *run_ctx, client *engine_client, client *ca
...
@@ -160,7 +160,7 @@ int scriptPrepareForRun(scriptRunCtx *run_ctx, client *engine_client, client *ca
return
C_ERR
;
return
C_ERR
;
}
}
/* Deny writes if we're unale to persist. */
/* Deny writes if we're una
b
le to persist. */
int
deny_write_type
=
writeCommandsDeniedByDiskError
();
int
deny_write_type
=
writeCommandsDeniedByDiskError
();
if
(
deny_write_type
!=
DISK_ERROR_TYPE_NONE
&&
!
obey_client
)
{
if
(
deny_write_type
!=
DISK_ERROR_TYPE_NONE
&&
!
obey_client
)
{
if
(
deny_write_type
==
DISK_ERROR_TYPE_RDB
)
if
(
deny_write_type
==
DISK_ERROR_TYPE_RDB
)
...
...
src/server.c
View file @
0b159b34
...
@@ -216,7 +216,7 @@ mstime_t commandTimeSnapshot(void) {
...
@@ -216,7 +216,7 @@ mstime_t commandTimeSnapshot(void) {
* may re-open the same key multiple times, can invalidate an already
* may re-open the same key multiple times, can invalidate an already
* open object in a next call, if the next call will see the key expired,
* open object in a next call, if the next call will see the key expired,
* while the first did not.
* while the first did not.
* This is specific
l
ally important in the context of scripts, where we
* This is specifically important in the context of scripts, where we
* pretend that time freezes. This way a key can expire only the first time
* pretend that time freezes. This way a key can expire only the first time
* it is accessed and not in the middle of the script execution, making
* it is accessed and not in the middle of the script execution, making
* propagation to slaves / AOF consistent. See issue #1525 for more info.
* propagation to slaves / AOF consistent. See issue #1525 for more info.
...
...
src/server.h
View file @
0b159b34
...
@@ -895,7 +895,7 @@ struct redisObject {
...
@@ -895,7 +895,7 @@ struct redisObject {
void
*
ptr
;
void
*
ptr
;
};
};
/* The
a
string name for an object's type as listed above
/* The string name for an object's type as listed above
* Native types are checked against the OBJ_STRING, OBJ_LIST, OBJ_* defines,
* Native types are checked against the OBJ_STRING, OBJ_LIST, OBJ_* defines,
* and Module types have their registered name returned. */
* and Module types have their registered name returned. */
char
*
getObjectTypeName
(
robj
*
);
char
*
getObjectTypeName
(
robj
*
);
...
@@ -929,7 +929,7 @@ typedef struct clientReplyBlock {
...
@@ -929,7 +929,7 @@ typedef struct clientReplyBlock {
* | / \
* | / \
* | / \
* | / \
* Repl Backlog Replica_A Replica_B
* Repl Backlog Replica_A Replica_B
*
*
* Each replica or replication backlog increments only the refcount of the
* Each replica or replication backlog increments only the refcount of the
* 'ref_repl_buf_node' which it points to. So when replica walks to the next
* 'ref_repl_buf_node' which it points to. So when replica walks to the next
* node, it should first increase the next node's refcount, and when we trim
* node, it should first increase the next node's refcount, and when we trim
...
@@ -1087,7 +1087,7 @@ typedef struct {
...
@@ -1087,7 +1087,7 @@ typedef struct {
need more reserved IDs use UINT64_MAX-1,
need more reserved IDs use UINT64_MAX-1,
-2, ... and so forth. */
-2, ... and so forth. */
/* Replication backlog is not separate memory, it just is one consumer of
/* Replication backlog is not
a
separate memory, it just is one consumer of
* the global replication buffer. This structure records the reference of
* the global replication buffer. This structure records the reference of
* replication buffers. Since the replication buffer block list may be very long,
* replication buffers. Since the replication buffer block list may be very long,
* it would cost much time to search replication offset on partial resync, so
* it would cost much time to search replication offset on partial resync, so
...
@@ -1223,7 +1223,7 @@ typedef struct client {
...
@@ -1223,7 +1223,7 @@ typedef struct client {
* unloaded for cleanup. Opaque for Redis Core.*/
* unloaded for cleanup. Opaque for Redis Core.*/
/* If this client is in tracking mode and this field is non zero,
/* If this client is in tracking mode and this field is non zero,
* invalidation messages for keys fetched by this client will be sen
d
to
* invalidation messages for keys fetched by this client will be sen
t
to
* the specified client ID. */
* the specified client ID. */
uint64_t
client_tracking_redirection
;
uint64_t
client_tracking_redirection
;
rax
*
client_tracking_prefixes
;
/* A dictionary of prefixes we are already
rax
*
client_tracking_prefixes
;
/* A dictionary of prefixes we are already
...
@@ -1786,7 +1786,7 @@ struct redisServer {
...
@@ -1786,7 +1786,7 @@ struct redisServer {
char
*
rdb_pipe_buff
;
/* In diskless replication, this buffer holds data */
char
*
rdb_pipe_buff
;
/* In diskless replication, this buffer holds data */
int
rdb_pipe_bufflen
;
/* that was read from the rdb pipe. */
int
rdb_pipe_bufflen
;
/* that was read from the rdb pipe. */
int
rdb_key_save_delay
;
/* Delay in microseconds between keys while
int
rdb_key_save_delay
;
/* Delay in microseconds between keys while
* writing
the RDB
. (for testings). negative
* writing
aof or rdb
. (for testings). negative
* value means fractions of microseconds (on average). */
* value means fractions of microseconds (on average). */
int
key_load_delay
;
/* Delay in microseconds between keys while
int
key_load_delay
;
/* Delay in microseconds between keys while
* loading aof or rdb. (for testings). negative
* loading aof or rdb. (for testings). negative
...
@@ -1964,7 +1964,7 @@ struct redisServer {
...
@@ -1964,7 +1964,7 @@ struct redisServer {
REDISMODULE_CLUSTER_FLAG_*. */
REDISMODULE_CLUSTER_FLAG_*. */
int
cluster_allow_reads_when_down
;
/* Are reads allowed when the cluster
int
cluster_allow_reads_when_down
;
/* Are reads allowed when the cluster
is down? */
is down? */
int
cluster_config_file_lock_fd
;
/* cluster config fd, will be flock */
int
cluster_config_file_lock_fd
;
/* cluster config fd, will be flock
ed.
*/
unsigned
long
long
cluster_link_msg_queue_limit_bytes
;
/* Memory usage limit on individual link msg queue */
unsigned
long
long
cluster_link_msg_queue_limit_bytes
;
/* Memory usage limit on individual link msg queue */
int
cluster_drop_packet_filter
;
/* Debug config that allows tactically
int
cluster_drop_packet_filter
;
/* Debug config that allows tactically
* dropping packets of a specific type */
* dropping packets of a specific type */
...
...
src/t_list.c
View file @
0b159b34
...
@@ -526,7 +526,7 @@ void lpushxCommand(client *c) {
...
@@ -526,7 +526,7 @@ void lpushxCommand(client *c) {
pushGenericCommand
(
c
,
LIST_HEAD
,
1
);
pushGenericCommand
(
c
,
LIST_HEAD
,
1
);
}
}
/* RPUSH <key> <element> [<element> ...] */
/* RPUSH
X
<key> <element> [<element> ...] */
void
rpushxCommand
(
client
*
c
)
{
void
rpushxCommand
(
client
*
c
)
{
pushGenericCommand
(
c
,
LIST_TAIL
,
1
);
pushGenericCommand
(
c
,
LIST_TAIL
,
1
);
}
}
...
...
tests/unit/pause.tcl
View file @
0b159b34
...
@@ -83,7 +83,7 @@ start_server {tags {"pause network"}} {
...
@@ -83,7 +83,7 @@ start_server {tags {"pause network"}} {
$rd2 close
$rd2 close
}
}
test
"Test read/admin mu
t
li-execs are not blocked by pause RO"
{
test
"Test read/admin mul
t
i-execs are not blocked by pause RO"
{
r SET FOO BAR
r SET FOO BAR
r client PAUSE 100000 WRITE
r client PAUSE 100000 WRITE
set rr
[
redis_client
]
set rr
[
redis_client
]
...
@@ -96,7 +96,7 @@ start_server {tags {"pause network"}} {
...
@@ -96,7 +96,7 @@ start_server {tags {"pause network"}} {
$rr close
$rr close
}
}
test
"Test write mu
t
li-execs are blocked by pause RO"
{
test
"Test write mul
t
i-execs are blocked by pause RO"
{
set rd
[
redis_deferring_client
]
set rd
[
redis_deferring_client
]
$rd MULTI
$rd MULTI
assert_equal
[
$rd
read
]
"OK"
assert_equal
[
$rd
read
]
"OK"
...
@@ -174,7 +174,7 @@ start_server {tags {"pause network"}} {
...
@@ -174,7 +174,7 @@ start_server {tags {"pause network"}} {
$rr close
$rr close
}
}
test
"Test read-only scripts in mu
t
li-exec are not blocked by pause RO"
{
test
"Test read-only scripts in mul
t
i-exec are not blocked by pause RO"
{
r SET FOO BAR
r SET FOO BAR
r client PAUSE 100000 WRITE
r client PAUSE 100000 WRITE
set rr
[
redis_client
]
set rr
[
redis_client
]
...
@@ -193,7 +193,7 @@ start_server {tags {"pause network"}} {
...
@@ -193,7 +193,7 @@ start_server {tags {"pause network"}} {
$rr close
$rr close
}
}
test
"Test write scripts in mu
t
li-exec are blocked by pause RO"
{
test
"Test write scripts in mul
t
i-exec are blocked by pause RO"
{
set rd
[
redis_deferring_client
]
set rd
[
redis_deferring_client
]
set rd2
[
redis_deferring_client
]
set rd2
[
redis_deferring_client
]
...
...
tests/unit/type/list.tcl
View file @
0b159b34
...
@@ -2198,8 +2198,8 @@ foreach {pop} {BLPOP BLMPOP_RIGHT} {
...
@@ -2198,8 +2198,8 @@ foreach {pop} {BLPOP BLMPOP_RIGHT} {
$rd1 BLPOP mylist 0
$rd1 BLPOP mylist 0
wait_for_blocked_clients_count 1
wait_for_blocked_clients_count 1
# pipline on other client a list push and a blocking pop
# pip
e
line on other client a list push and a blocking pop
# we should expect the fainess to be kept and have $rd1
# we should expect the fai
r
ness to be kept and have $rd1
# being unblocked
# being unblocked
set buf
""
set buf
""
append buf
"LPUSH mylist 1
\r\n
"
append buf
"LPUSH mylist 1
\r\n
"
...
@@ -2256,7 +2256,7 @@ foreach {pop} {BLPOP BLMPOP_RIGHT} {
...
@@ -2256,7 +2256,7 @@ foreach {pop} {BLPOP BLMPOP_RIGHT} {
$rd3 close
$rd3 close
}
}
test
"Blocking command acounted only once in commandstats"
{
test
"Blocking command ac
c
ounted only once in commandstats"
{
# cleanup first
# cleanup first
r del mylist
r del mylist
...
@@ -2279,7 +2279,7 @@ foreach {pop} {BLPOP BLMPOP_RIGHT} {
...
@@ -2279,7 +2279,7 @@ foreach {pop} {BLPOP BLMPOP_RIGHT} {
$rd close
$rd close
}
}
test
"Blocking command acounted only once in commandstats after timeout"
{
test
"Blocking command ac
c
ounted only once in commandstats after timeout"
{
# cleanup first
# cleanup first
r del mylist
r del mylist
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment