Skip to content

Fix assertion when a key is lazy expired during cluster key migration#11176

Merged
oranagra merged 4 commits intoredis:unstablefrom
oranagra:fix_cluster_assert_on_lazy_expire
Aug 24, 2022
Merged

Fix assertion when a key is lazy expired during cluster key migration#11176
oranagra merged 4 commits intoredis:unstablefrom
oranagra:fix_cluster_assert_on_lazy_expire

Conversation

@oranagra
Copy link
Member

Redis 7.0 has #9890 which added an assertion when the propagation queue
was not flushed and we got to beforeSleep.
But it turns out that when processCommands calls getNodeByQuery and
decides to reject the command, it can lead to a key that was lazy
expired and is deleted without later flushing the propagation queue.

This change prevents lazy expiry from deleting the key at this stage
(not as part of a command being processed in call)

Closes #11014

Redis 7.0 has #9890 which added an assertion when the propagation queue
was not flushed and we got to beforeSleep.
But it turns out that when processCommands calls getNodeByQuery and
decides to reject the command, it can lead to a key that was lazy
expired and is deleted without later flushing the propagation queue.

This change prevents lazy expiry from deleting the key at this stage
(not as part of a command being processed in `call`)

Closes #11014

Co-authored-by: Madelyn Olson <[email protected]>
@oranagra oranagra requested review from guybe7 and madolson August 23, 2022 11:44
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @enjoy-binbin's minor suggestions.

@oranagra oranagra added the approval-needed Waiting for core team approval to be merged label Aug 24, 2022
@oranagra oranagra merged commit c789fb0 into redis:unstable Aug 24, 2022
@oranagra oranagra deleted the fix_cluster_assert_on_lazy_expire branch August 24, 2022 16:39
@oranagra oranagra added the release-notes indication that this issue needs to be mentioned in the release notes label Aug 24, 2022
@oranagra oranagra mentioned this pull request Sep 21, 2022
oranagra added a commit that referenced this pull request Sep 21, 2022
…#11176)

Redis 7.0 has #9890 which added an assertion when the propagation queue
was not flushed and we got to beforeSleep.
But it turns out that when processCommands calls getNodeByQuery and
decides to reject the command, it can lead to a key that was lazy
expired and is deleted without later flushing the propagation queue.

This change prevents lazy expiry from deleting the key at this stage
(not as part of a command being processed in `call`)

(cherry picked from commit c789fb0)
madolson pushed a commit to madolson/redis that referenced this pull request Apr 19, 2023
…redis#11176)

Redis 7.0 has redis#9890 which added an assertion when the propagation queue
was not flushed and we got to beforeSleep.
But it turns out that when processCommands calls getNodeByQuery and
decides to reject the command, it can lead to a key that was lazy
expired and is deleted without later flushing the propagation queue.

This change prevents lazy expiry from deleting the key at this stage
(not as part of a command being processed in `call`)
enjoy-binbin pushed a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
…redis#11176)

Redis 7.0 has redis#9890 which added an assertion when the propagation queue
was not flushed and we got to beforeSleep.
But it turns out that when processCommands calls getNodeByQuery and
decides to reject the command, it can lead to a key that was lazy
expired and is deleted without later flushing the propagation queue.

This change prevents lazy expiry from deleting the key at this stage
(not as part of a command being processed in `call`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval-needed Waiting for core team approval to be merged release-notes indication that this issue needs to be mentioned in the release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[CRASH] Failure to rebalance on 7.0.0-rc2

5 participants