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
58554396
Commit
58554396
authored
Dec 18, 2019
by
zhaozhao.zz
Browse files
incrbyfloat: fix issue #5256 ttl lost after propagate
parent
24044f33
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/t_string.c
View file @
58554396
...
@@ -405,7 +405,7 @@ void decrbyCommand(client *c) {
...
@@ -405,7 +405,7 @@ void decrbyCommand(client *c) {
void
incrbyfloatCommand
(
client
*
c
)
{
void
incrbyfloatCommand
(
client
*
c
)
{
long
double
incr
,
value
;
long
double
incr
,
value
;
robj
*
o
,
*
new
,
*
aux
;
robj
*
o
,
*
new
,
*
aux
1
,
*
aux2
;
o
=
lookupKeyWrite
(
c
->
db
,
c
->
argv
[
1
]);
o
=
lookupKeyWrite
(
c
->
db
,
c
->
argv
[
1
]);
if
(
o
!=
NULL
&&
checkType
(
c
,
o
,
OBJ_STRING
))
return
;
if
(
o
!=
NULL
&&
checkType
(
c
,
o
,
OBJ_STRING
))
return
;
...
@@ -431,10 +431,13 @@ void incrbyfloatCommand(client *c) {
...
@@ -431,10 +431,13 @@ void incrbyfloatCommand(client *c) {
/* Always replicate INCRBYFLOAT as a SET command with the final value
/* Always replicate INCRBYFLOAT as a SET command with the final value
* in order to make sure that differences in float precision or formatting
* in order to make sure that differences in float precision or formatting
* will not create differences in replicas or after an AOF restart. */
* will not create differences in replicas or after an AOF restart. */
aux
=
createStringObject
(
"SET"
,
3
);
aux
1
=
createStringObject
(
"SET"
,
3
);
rewriteClientCommandArgument
(
c
,
0
,
aux
);
rewriteClientCommandArgument
(
c
,
0
,
aux
1
);
decrRefCount
(
aux
);
decrRefCount
(
aux
1
);
rewriteClientCommandArgument
(
c
,
2
,
new
);
rewriteClientCommandArgument
(
c
,
2
,
new
);
aux2
=
createStringObject
(
"KEEPTTL"
,
7
);
rewriteClientCommandArgument
(
c
,
3
,
aux2
);
decrRefCount
(
aux2
);
}
}
void
appendCommand
(
client
*
c
)
{
void
appendCommand
(
client
*
c
)
{
...
...
tests/integration/replication.tcl
View file @
58554396
...
@@ -70,6 +70,13 @@ start_server {tags {"repl"}} {
...
@@ -70,6 +70,13 @@ start_server {tags {"repl"}} {
}
}
}
}
test
{
INCRBYFLOAT replication, should not remove expire
}
{
r set test 1 EX 100
r incrbyfloat test 0.1
after 1000
assert_equal
[
$A debug digest
]
[
$B debug digest
]
}
test
{
BRPOPLPUSH replication, when blocking against empty list
}
{
test
{
BRPOPLPUSH replication, when blocking against empty list
}
{
set rd
[
redis_deferring_client
]
set rd
[
redis_deferring_client
]
$rd brpoplpush a b 5
$rd brpoplpush a b 5
...
...
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