Skip to content

Fix SPOP/RESTORE propagation when doing lazy free - #12320

Merged
madolson merged 2 commits into
redis:unstablefrom
enjoy-binbin:spop_case1_propagate
Jun 16, 2023
Merged

madolson merged 2 commits into
redis:unstablefrom
enjoy-binbin:spop_case1_propagate

Conversation

@enjoy-binbin

@enjoy-binbin enjoy-binbin commented Jun 15, 2023 •

Copy link
Copy Markdown
Contributor

In SPOP, when COUNT is greater than or equal to set's size,
we will remove the set. In dbDelete, we will do DEL or UNLINK
according to the lazy flag. This is also required for propagate.

In RESTORE, we won't store expired keys into the db, see #7472.
When used together with REPLACE, it should emit a DEL or UNLINK
according to the lazy flag.

This PR also adds tests to cover the propagation. The RESTORE
test will also cover #7472.

Release notes (Bug fix or minor improvement)
Update SPOP and RESTORE commands to replicate unlink commands to replicas when the server is configured to use async server deletes.

@enjoy-binbin enjoy-binbin changed the title Fix SPOP propagation when COUNT is greater than set's size Fix SPOP propagation when COUNT is greater than or equal to set's size Jun 15, 2023
Comment thread src/t_set.c Resolved
In SPOP, when COUNT is greater than or equal to set's size,
we will remove the set. In dbDelete, we will do DEL or UNLINK
according to the lazy flag. This is also required for propagate.

In RESTORE, we won't store expired keys into the db, see redis#7472.
When used together with REPLACE, it should emit a DEL or UNLINK
according to the lazy flag.

This PR also adds tests to cover the propagation. The RESTORE
test will also cover redis#7472.
@enjoy-binbin enjoy-binbin changed the title Fix SPOP propagation when COUNT is greater than or equal to set's size Fix SPOP/RESTORE propagation when doing lazy free Jun 16, 2023
@enjoy-binbin
enjoy-binbin force-pushed the spop_case1_propagate branch from 0b254b8 to 7321031 Compare June 16, 2023 03:31
@madolson
madolson merged commit 439b031 into redis:unstable Jun 16, 2023
@madolson madolson added the release-notes indication that this issue needs to be mentioned in the release notes label Jun 16, 2023
@enjoy-binbin
enjoy-binbin deleted the spop_case1_propagate branch June 16, 2023 17:05
@oranagra oranagra mentioned this pull request Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants