Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Inter in ZSet::InterStore into a separate function #1726

Merged
merged 6 commits into from
Sep 3, 2023

Conversation

enjoy-binbin
Copy link
Member

@enjoy-binbin enjoy-binbin commented Sep 2, 2023

CI TSAN show ZINTERSTORE may has a deadlock after introducing
locks to DEL in #1712. In ZSet::InterStore if the dst key was
inside the source key list we may have a deadlock since the
OverWrite function will also lock the dst key.

In this PR, we split Inter in ZSet::InterStore into a separate
function, just like the Set apis.

After this PR, after the CI verification in #1712, it can pass
the CI verification now. Closes #1715

This PR also do a saved_cnt cleanup since it is same as members.size().

CI TSAN show ZINTERSTORE may has a deadlock after introducing
locks to DEL in apache#1712. In ZSet::InterStore if the dst key was
inside the source key list we may have a deadlock since the
OverWrite function will also lock the dst key.

In this PR, we split Inter in ZSet::InterStore into a separate
function, just like the Set apis.

After this PR, after the CI verification in apache#1712, it can pass
the CI verification now.
git-hulk
git-hulk previously approved these changes Sep 2, 2023
src/types/redis_zset.cc Outdated Show resolved Hide resolved
@enjoy-binbin enjoy-binbin merged commit aaff696 into apache:unstable Sep 3, 2023
@enjoy-binbin enjoy-binbin deleted the split_InterStore branch September 3, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We may have the deadlock in ZSet::InterStore(as well as other similar APIs)
4 participants