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

Relax race condition between subkey compaction thread #1335

Merged
merged 12 commits into from
Mar 21, 2023

Conversation

dongdongwcpp
Copy link
Contributor

@dongdongwcpp dongdongwcpp commented Mar 20, 2023

lazy delete to best effort relax race condition between command Expire and subkey Compaction.

It closes #1298.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Could you elaborate a bit how you fix this race condition logically? Generally, "wait for a while" is not logically correct but best effort.

@PragmaTwice PragmaTwice changed the title fix issues 1298 Fix race condition between subkey compaction thread Mar 20, 2023
@PragmaTwice
Copy link
Member

Could you elaborate a bit how you fix this race condition logically? Generally, "wait for a while" is not logically correct but best effort.

Hi @tisonkun , this race is triggered by modifying the expire time of a key while compacting. Rare in real-world but indeed a race.

In my view, since it is hard and expensive to add locking to both compacting and command executing, waiting is the currently best way to avoid the race.

@tisonkun
Copy link
Member

Could you elaborate a bit how you fix this race condition logically? Generally, "wait for a while" is not logically correct but best effort.

Hi @tisonkun , this race is triggered by modifying the expire time of a key while compacting. Rare in real-world but indeed a race.

In my view, since it is hard and expensive to add locking to both compacting and command executing, waiting is the currently best way to avoid the race.

Thank you. Then let's update the PR title as "Relax ..." instead of "Fix ...".

@tisonkun tisonkun changed the title Fix race condition between subkey compaction thread Relax race condition between subkey compaction thread Mar 20, 2023
@git-hulk
Copy link
Member

Thanks all, merging...

@git-hulk git-hulk merged commit 739e1cd into apache:unstable Mar 21, 2023
@git-hulk
Copy link
Member

Thanks for your contribution again @dongdongwcpp

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.

race condition between subkey compaction thread and Expire command
4 participants