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
84d056d0
Unverified
Commit
84d056d0
authored
Mar 14, 2021
by
Huang Zhw
Committed by
GitHub
Mar 14, 2021
Browse files
Fix typo and outdated comments. (#8640)
parent
3a5905fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/aof.c
View file @
84d056d0
...
@@ -1590,7 +1590,7 @@ int rewriteAppendOnlyFile(char *filename) {
...
@@ -1590,7 +1590,7 @@ int rewriteAppendOnlyFile(char *filename) {
if
(
write
(
server
.
aof_pipe_write_ack_to_parent
,
"!"
,
1
)
!=
1
)
goto
werr
;
if
(
write
(
server
.
aof_pipe_write_ack_to_parent
,
"!"
,
1
)
!=
1
)
goto
werr
;
if
(
anetNonBlock
(
NULL
,
server
.
aof_pipe_read_ack_from_parent
)
!=
ANET_OK
)
if
(
anetNonBlock
(
NULL
,
server
.
aof_pipe_read_ack_from_parent
)
!=
ANET_OK
)
goto
werr
;
goto
werr
;
/* We read the ACK from the server using a
10
seconds timeout. Normally
/* We read the ACK from the server using a
5
seconds timeout. Normally
* it should reply ASAP, but just in case we lose its reply, we are sure
* it should reply ASAP, but just in case we lose its reply, we are sure
* the child will eventually get terminated. */
* the child will eventually get terminated. */
if
(
syncRead
(
server
.
aof_pipe_read_ack_from_parent
,
&
byte
,
1
,
5000
)
!=
1
||
if
(
syncRead
(
server
.
aof_pipe_read_ack_from_parent
,
&
byte
,
1
,
5000
)
!=
1
||
...
...
src/module.c
View file @
84d056d0
...
@@ -606,7 +606,7 @@ void moduleHandlePropagationAfterCommandCallback(RedisModuleCtx *ctx) {
...
@@ -606,7 +606,7 @@ void moduleHandlePropagationAfterCommandCallback(RedisModuleCtx *ctx) {
* a transaction. */
* a transaction. */
if (!server.propagate_in_transaction) return;
if (!server.propagate_in_transaction) return;
/* If this command is executed from with Lua or MULTI/EXEC we do no
y
/* If this command is executed from with Lua or MULTI/EXEC we do no
t
* need to propagate EXEC */
* need to propagate EXEC */
if (server.in_eval || server.in_exec) return;
if (server.in_eval || server.in_exec) return;
...
...
src/multi.c
View file @
84d056d0
...
@@ -140,7 +140,7 @@ void execCommandPropagateExec(int dbid) {
...
@@ -140,7 +140,7 @@ void execCommandPropagateExec(int dbid) {
}
}
/* Aborts a transaction, with a specific error message.
/* Aborts a transaction, with a specific error message.
* The transaction is always abo
a
rted with -EXECABORT so that the client knows
* The transaction is always aborted with -EXECABORT so that the client knows
* the server exited the multi state, but the actual reason for the abort is
* the server exited the multi state, but the actual reason for the abort is
* included too.
* included too.
* Note: 'error' may or may not end with \r\n. see addReplyErrorFormat. */
* Note: 'error' may or may not end with \r\n. see addReplyErrorFormat. */
...
@@ -202,7 +202,7 @@ void execCommand(client *c) {
...
@@ -202,7 +202,7 @@ void execCommand(client *c) {
c
->
cmd
=
c
->
mstate
.
commands
[
j
].
cmd
;
c
->
cmd
=
c
->
mstate
.
commands
[
j
].
cmd
;
/* ACL permissions are also checked at the time of execution in case
/* ACL permissions are also checked at the time of execution in case
* they were changed after the commands were qu
q
ued. */
* they were changed after the commands were qu
e
ued. */
int
acl_errpos
;
int
acl_errpos
;
int
acl_retval
=
ACLCheckCommandPerm
(
c
,
&
acl_errpos
);
int
acl_retval
=
ACLCheckCommandPerm
(
c
,
&
acl_errpos
);
if
(
acl_retval
==
ACL_OK
&&
c
->
cmd
->
proc
==
publishCommand
)
if
(
acl_retval
==
ACL_OK
&&
c
->
cmd
->
proc
==
publishCommand
)
...
...
src/replication.c
View file @
84d056d0
...
@@ -892,17 +892,34 @@ void syncCommand(client *c) {
...
@@ -892,17 +892,34 @@ void syncCommand(client *c) {
}
}
/* REPLCONF <option> <value> <option> <value> ...
/* REPLCONF <option> <value> <option> <value> ...
* This command is used by a
slave
in order to configure the replication
* This command is used by a
replica
in order to configure the replication
* process before starting it with the SYNC command.
* process before starting it with the SYNC command.
* This command is also used by a master in order to get the replication
* offset from a replica.
*
*
* Currently the only use of this command is to communicate to the master
* Currently we support these options:
* what is the listening port of the Slave redis instance, so that the
* master can accurately list slaves and their listening ports in
* the INFO output.
*
*
* In the future the same command can be used in order to configure
* - listening-port <port>
* the replication to initiate an incremental replication instead of a
* - ip-address <ip>
* full resync. */
* What is the listening ip and port of the Replica redis instance, so that
* the master can accurately lists replicas and their listening ports in the
* INFO output.
*
* - capa <eof|psync2>
* What is the capabilities of this instance.
* eof: supports EOF-style RDB transfer for diskless replication.
* psync2: supports PSYNC v2, so understands +CONTINUE <new repl ID>.
*
* - ack <offset>
* Replica informs the master the amount of replication stream that it
* processed so far.
*
* - getack
* Unlike other subcommands, this is used by master to get the replication
* offset from a replica.
*
* - rdb-only
* Only wants RDB snapshot without replication buffer. */
void
replconfCommand
(
client
*
c
)
{
void
replconfCommand
(
client
*
c
)
{
int
j
;
int
j
;
...
@@ -3544,7 +3561,7 @@ void abortFailover(const char *err) {
...
@@ -3544,7 +3561,7 @@ void abortFailover(const char *err) {
}
}
/*
/*
* FAILOVER [TO <HOST> <
I
P> [FORCE]] [ABORT] [TIMEOUT <timeout>]
* FAILOVER [TO <HOST> <P
ORT
> [FORCE]] [ABORT] [TIMEOUT <timeout>]
*
*
* This command will coordinate a failover between the master and one
* This command will coordinate a failover between the master and one
* of its replicas. The happy path contains the following steps:
* of its replicas. The happy path contains the following steps:
...
@@ -3647,7 +3664,7 @@ void failoverCommand(client *c) {
...
@@ -3647,7 +3664,7 @@ void failoverCommand(client *c) {
client
*
replica
=
findReplica
(
host
,
port
);
client
*
replica
=
findReplica
(
host
,
port
);
if
(
replica
==
NULL
)
{
if
(
replica
==
NULL
)
{
addReplyError
(
c
,
"FAILOVER target HOST and
I
P is not "
addReplyError
(
c
,
"FAILOVER target HOST and P
ORT
is not "
"a replica."
);
"a replica."
);
return
;
return
;
}
}
...
...
src/rio.c
View file @
84d056d0
...
@@ -160,7 +160,7 @@ void rioInitWithFile(rio *r, FILE *fp) {
...
@@ -160,7 +160,7 @@ void rioInitWithFile(rio *r, FILE *fp) {
}
}
/* ------------------- Connection implementation -------------------
/* ------------------- Connection implementation -------------------
* We use this RIO impleme
t
nation when reading an RDB file directly from
* We use this RIO implemen
t
ation when reading an RDB file directly from
* the connection to the memory via rdbLoadRio(), thus this implementation
* the connection to the memory via rdbLoadRio(), thus this implementation
* only implements reading from a connection that is, normally,
* only implements reading from a connection that is, normally,
* just a socket. */
* just a socket. */
...
@@ -262,7 +262,7 @@ void rioInitWithConn(rio *r, connection *conn, size_t read_limit) {
...
@@ -262,7 +262,7 @@ void rioInitWithConn(rio *r, connection *conn, size_t read_limit) {
sdsclear
(
r
->
io
.
conn
.
buf
);
sdsclear
(
r
->
io
.
conn
.
buf
);
}
}
/* Release the RIO tream. Optionally returns the unread buffered data
/* Release the RIO
s
tream. Optionally returns the unread buffered data
* when the SDS pointer 'remaining' is passed. */
* when the SDS pointer 'remaining' is passed. */
void
rioFreeConn
(
rio
*
r
,
sds
*
remaining
)
{
void
rioFreeConn
(
rio
*
r
,
sds
*
remaining
)
{
if
(
remaining
&&
(
size_t
)
r
->
io
.
conn
.
pos
<
sdslen
(
r
->
io
.
conn
.
buf
))
{
if
(
remaining
&&
(
size_t
)
r
->
io
.
conn
.
pos
<
sdslen
(
r
->
io
.
conn
.
buf
))
{
...
...
src/server.h
View file @
84d056d0
...
@@ -838,7 +838,7 @@ typedef struct {
...
@@ -838,7 +838,7 @@ typedef struct {
the flag ALLKEYS is set in the user. */
the flag ALLKEYS is set in the user. */
list
*
channels
;
/* A list of allowed Pub/Sub channel patterns. If this
list
*
channels
;
/* A list of allowed Pub/Sub channel patterns. If this
field is NULL the user cannot mention any channel in a
field is NULL the user cannot mention any channel in a
`PUBLISH` or [P][UNSU
S
BSCRIBE] command, unless the flag
`PUBLISH` or [P][UNSUBSCRIBE] command, unless the flag
ALLCHANNELS is set in the user. */
ALLCHANNELS is set in the user. */
}
user
;
}
user
;
...
...
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