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

refactor: remove read state #857

Merged
merged 2 commits into from
Jul 12, 2024
Merged

Conversation

bsbds
Copy link
Collaborator

@bsbds bsbds commented Jun 17, 2024

Depends-On: #851 #852

Closes: #782, #501, #497, as we don't rely on this mechanism any more

Removes the current read state mechanism, and sets all proxied etcd commands to use slow path.

The read state requires the leader to query it's UncommittedPool. However, for every query, we must lock it in another tokio worker thread. Lock in multiple threads could reduce general performance, I think it's best to remove the current implementation and reimplement it in the future.

All etcd commands need to use slow path because we need 2RTTs to acquire a revision.

Please briefly answer these questions:

  • what problem are you trying to solve? (or if there's no problem, what's the motivation for this change?)

  • what changes does this pull request make?

  • are there any non-obvious implications of these changes? (does it break compatibility with previous versions, etc)

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 58.33333% with 10 lines in your changes missing coverage. Please review.

Project coverage is 75.61%. Comparing base (e35b35a) to head (ae0401f).
Report is 132 commits behind head on master.

Files Patch % Lines
crates/xline/src/server/kv_server.rs 41.17% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #857      +/-   ##
==========================================
+ Coverage   75.55%   75.61%   +0.06%     
==========================================
  Files         180      187       +7     
  Lines       26938    27618     +680     
  Branches    26938    27618     +680     
==========================================
+ Hits        20353    20884     +531     
- Misses       5366     5447      +81     
- Partials     1219     1287      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

bsbds added a commit to bsbds/Xline that referenced this pull request Jun 17, 2024
refactor: disable fast path in etcd competible layer

WIP: fix rebase kv server
Signed-off-by: bsbds <[email protected]>
@bsbds bsbds marked this pull request as ready for review June 18, 2024 02:54
Copy link

mergify bot commented Jun 18, 2024

@bsbds Convert your pr to draft since CI failed

@mergify mergify bot marked this pull request as draft June 18, 2024 02:54
@mergify mergify bot added the CI:fail CI has failed label Jun 18, 2024
@mergify mergify bot requested a review from a team June 18, 2024 02:54
@mergify mergify bot marked this pull request as ready for review June 25, 2024 11:32
@mergify mergify bot removed the CI:fail CI has failed label Jun 25, 2024
@bsbds bsbds added this to the v0.7.0 milestone Jul 1, 2024
Copy link
Collaborator

@Phoenix500526 Phoenix500526 left a comment

Choose a reason for hiding this comment

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

Please leave an issue to track this problem: when a network partition occurs, the leader in the smaller partition may not be aware that a new leader has already been elected in the cluster. If the original leader continues to serve read-only requests to clients during this time, it could result in stale reads.

@mergify mergify bot requested a review from a team July 2, 2024 02:11
@bsbds
Copy link
Collaborator Author

bsbds commented Jul 2, 2024

Please leave an issue to track this problem: when a network partition occurs, the leader in the smaller partition may not be aware that a new leader has already been elected in the cluster. If the original leader continues to serve read-only requests to clients during this time, it could result in stale reads.

Tracked in #870

@mergify mergify bot requested a review from a team July 2, 2024 09:19
@Phoenix500526 Phoenix500526 merged commit 05954e0 into xline-kv:master Jul 12, 2024
13 of 14 checks passed
bsbds added a commit to bsbds/Xline that referenced this pull request Jul 12, 2024
refactor: disable fast path in etcd competible layer

WIP: fix rebase kv server
Signed-off-by: bsbds <[email protected]>
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.

[Bug]: The test case curp::it read_state::read_state sometimes failed
2 participants