Skip to content

Reset the ttl for additional keys#3673

Merged
antirez merged 1 commit intoredis:unstablefrom
badboy:reset-ttl-on-migrating
Dec 14, 2016
Merged

Reset the ttl for additional keys#3673
antirez merged 1 commit intoredis:unstablefrom
badboy:reset-ttl-on-migrating

Conversation

@badboy
Copy link
Contributor

@badboy badboy commented Dec 8, 2016

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

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
@badboy
Copy link
Contributor Author

badboy commented Dec 8, 2016

I did not run any tests due to lack of a proper Cluster setup at the moment, but this fix is kinda trivial when reading the code (ttl is not touched anywhere else)

@antirez antirez added this to the Urgent milestone Dec 13, 2016
@antirez
Copy link
Contributor

antirez commented Dec 14, 2016

Good work on that @badboy, thanks. I guess we can also kill the ttl = 0 initialization earlier? (at line 4768).

@antirez antirez merged commit c9f0456 into redis:unstable Dec 14, 2016
@antirez
Copy link
Contributor

antirez commented Dec 14, 2016

Ok killed the ttl init earlier and actually declared ttl / expireat later in the code in a more inner scope. Thanks!

antirez added a commit that referenced this pull request Dec 14, 2016
After the fix for #3673 the ttl var is always initialized inside the
loop itself, so the early initialization is not needed.

Variables declaration also moved to a more local scope.
antirez added a commit that referenced this pull request Dec 14, 2016
After the fix for #3673 the ttl var is always initialized inside the
loop itself, so the early initialization is not needed.

Variables declaration also moved to a more local scope.
antirez added a commit that referenced this pull request Dec 14, 2016
After the fix for #3673 the ttl var is always initialized inside the
loop itself, so the early initialization is not needed.

Variables declaration also moved to a more local scope.
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Feb 17, 2017
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Feb 17, 2017
After the fix for redis#3673 the ttl var is always initialized inside the
loop itself, so the early initialization is not needed.

Variables declaration also moved to a more local scope.
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request May 16, 2017
After the fix for redis#3673 the ttl var is always initialized inside the
loop itself, so the early initialization is not needed.

Variables declaration also moved to a more local scope.
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Jan 13, 2018
After the fix for redis#3673 the ttl var is always initialized inside the
loop itself, so the early initialization is not needed.

Variables declaration also moved to a more local scope.
pulllock pushed a commit to pulllock/redis that referenced this pull request Jun 28, 2023
pulllock pushed a commit to pulllock/redis that referenced this pull request Jun 28, 2023
After the fix for redis#3673 the ttl var is always initialized inside the
loop itself, so the early initialization is not needed.

Variables declaration also moved to a more local scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants