-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Bug]: Read State #497
Comments
The fix for the first and third is trivial. I'll provide some details about the refactor for the second issue. As the after sync stage is execute concurrently, we need to first wait for the lower index to complete, before we trigger the higher index. I uses a binary heap(min heap), aka priority_queue, to track the index triggered. And we use struct IndexBarrierInner {
next: u64,
indices: BinaryHeap<IndexRevision>,
} Each time the after sync triggers a index, we push it into the heap and do the following procedure repeatedly: check the heap top if it's equal to pub(crate) fn trigger(&self, index: u64, revision: i64) {
let mut inner_l = self.inner.lock();
inner_l.indices.push(IndexRevision::new(index, revision));
while inner_l
.indices
.peek()
.map_or(false, |i| i.index.eq(&inner_l.next))
{
let next = inner_l.next;
let IndexRevision { index, revision } = inner_l
.indices
.pop()
.unwrap_or_else(|| unreachable!("IndexRevision should be Some"));
inner_l.next = next.overflow_add(1);
}
} |
Issue 2 and 3 are no longer valid after recent refactor, I will only fix the first one. |
Refer to: #782 |
Closed in #857 |
There are several read-state related bugs found in the jepsen tests.
Sometimes the cmd ids are lost during the test, this is caused by the current read state only collect
sp
, which is not sufficient, because the sp only store the current speculative execute cmd, but later conflict command will goes into ucp. The solution is to add ucp cmds to read state response.Currently the
IndexBarrier
useslast_trigger_index
to track the last execute index. However the after sync in execute concurrently so a command with a larger index may execute before a command with a smaller index. This requires a refactor.The commit index may newer because the after sync in execute concurrently. And a cmd with higher log index may complete before a cmd with lower index. To resolve this problem we should combine wait commit index and wait cmd ids, after both returns could we proceed serializable read on current node.
The text was updated successfully, but these errors were encountered: