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

Fine-grained lock service in meta server #2750

Open
WenyXu opened this issue Nov 15, 2023 · 2 comments
Open

Fine-grained lock service in meta server #2750

WenyXu opened this issue Nov 15, 2023 · 2 comments
Labels
C-feature Category Features

Comments

@WenyXu
Copy link
Member

WenyXu commented Nov 15, 2023

What problem does the new feature solve?

It ensures correctness during procedures and reduces the lock's scope, making the procedure execution faster.

What does the feature do?

Considers introducing a fine-grained lock service(memory-based) in the meta server's leader. And procedure acquires locks on demand.

The incorrect locking
image
If we didn't acquire the lock before operating the shared resource, it might incur data inconsistency.

coarse-grained locking
image
The procedure acquires the coarse-grained lock during the whole procedure. However, if the scope of locks overlaps, procedures are executed serially.

fine-grained locking
image

Implementation challenges

However, if the old leader loses the leadership(e.g., network partition), its running procedure can still write data into etcd, which also incurs data inconsistency.

@WenyXu WenyXu added the C-feature Category Features label Nov 15, 2023
@killme2008
Copy link
Contributor

Looks interesting. I wonder what's the plan of this issue. @WenyXu

@WenyXu
Copy link
Member Author

WenyXu commented Jan 2, 2024

Looks interesting. I wonder what's the plan of this issue. @WenyXu

The fine-grained locks currently have yet to be planned. Let's implement the #3061 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category Features
Projects
None yet
Development

No branches or pull requests

2 participants