Skip to content

Commit

Permalink
Reset the ttl for additional keys
Browse files Browse the repository at this point in the history
Before, if a previous key had a TTL set but the current one didn't, the
TTL was reused and thus resulted in wrong expirations set.

This behaviour was experienced, when `MigrateDefaultPipeline` in
redis-trib was set to >1

Fixes #3655
  • Loading branch information
badboy committed Dec 8, 2016
1 parent 978a790 commit 2a32f03
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -4841,6 +4841,7 @@ void migrateCommand(client *c) {

/* Create RESTORE payload and generate the protocol to call the command. */
for (j = 0; j < num_keys; j++) {
ttl = 0;
expireat = getExpire(c->db,kv[j]);
if (expireat != -1) {
ttl = expireat-mstime();
Expand Down

0 comments on commit 2a32f03

Please sign in to comment.