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
dc8885a1
Commit
dc8885a1
authored
Mar 11, 2020
by
Itamar Haber
Committed by
antirez
Mar 25, 2020
Browse files
Adds keyspace notifications to migrate and restore
parent
bfb18e55
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
dc8885a1
...
@@ -4981,6 +4981,7 @@ void restoreCommand(client *c) {
...
@@ -4981,6 +4981,7 @@ void restoreCommand(client *c) {
}
}
objectSetLRUOrLFU
(
obj
,
lfu_freq
,
lru_idle
,
lru_clock
,
1000
);
objectSetLRUOrLFU
(
obj
,
lfu_freq
,
lru_idle
,
lru_clock
,
1000
);
signalModifiedKey
(
c
->
db
,
c
->
argv
[
1
]);
signalModifiedKey
(
c
->
db
,
c
->
argv
[
1
]);
notifyKeyspaceEvent
(
NOTIFY_GENERIC
,
"restore"
,
c
->
argv
[
1
],
c
->
db
->
id
);
addReply
(
c
,
shared
.
ok
);
addReply
(
c
,
shared
.
ok
);
server
.
dirty
++
;
server
.
dirty
++
;
}
}
...
@@ -5327,6 +5328,7 @@ try_again:
...
@@ -5327,6 +5328,7 @@ try_again:
/* No COPY option: remove the local key, signal the change. */
/* No COPY option: remove the local key, signal the change. */
dbDelete
(
c
->
db
,
kv
[
j
]);
dbDelete
(
c
->
db
,
kv
[
j
]);
signalModifiedKey
(
c
->
db
,
kv
[
j
]);
signalModifiedKey
(
c
->
db
,
kv
[
j
]);
notifyKeyspaceEvent
(
NOTIFY_GENERIC
,
"del"
,
kv
[
j
],
c
->
db
->
id
);
server
.
dirty
++
;
server
.
dirty
++
;
/* Populate the argument vector to replace the old one. */
/* Populate the argument vector to replace the old one. */
...
@@ -5489,7 +5491,7 @@ void readwriteCommand(client *c) {
...
@@ -5489,7 +5491,7 @@ void readwriteCommand(client *c) {
* already "down" but it is fragile to rely on the update of the global state,
* already "down" but it is fragile to rely on the update of the global state,
* so we also handle it here.
* so we also handle it here.
*
*
* CLUSTER_REDIR_DOWN_STATE and CLUSTER_REDIR_DOWN_RO_STATE if the cluster is
* CLUSTER_REDIR_DOWN_STATE and CLUSTER_REDIR_DOWN_RO_STATE if the cluster is
* down but the user attempts to execute a command that addresses one or more keys. */
* down but the user attempts to execute a command that addresses one or more keys. */
clusterNode
*
getNodeByQuery
(
client
*
c
,
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
hashslot
,
int
*
error_code
)
{
clusterNode
*
getNodeByQuery
(
client
*
c
,
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
hashslot
,
int
*
error_code
)
{
clusterNode
*
n
=
NULL
;
clusterNode
*
n
=
NULL
;
...
...
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