-
Notifications
You must be signed in to change notification settings - Fork 884
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
The known_applied_index is not increasing but applying_index is #277
Comments
It seems to be the problem of FSMCaller::do_committed. Each time this function pops a batch of logs to apply, but the applied index is only updated after the entire batch processed. |
A solution to this problem is to update applied index in a smaller batch. |
Thank you for replying. Locally I was able to reproduce this problem with the following sequence: a) Start a node and write 1,000 records (no snapshotting is done) This time, as the entries from the WAL are replayed, I see that the
So it seems like braft does not update applied index until the WAL is entirely caught up? This can cause issues when a node is under heavy load after a restart, since the WAL will continue growing and so applied_index will never progress. |
It will increase, the delay time depends on how long it takes to apply a batch of logs. The workflow of state machine can be described as following:
If it's in heavy load, step 2 may take a long time, and the gap between the committed index and |known_applied_index| will be large. However, it may confuse users, we will fix this problem. |
Thank you, that looks good 👍 |
We have a braft node (no clustering, just a single node) which is under high write load in which the
nodeStatus.applying_index
andnodeStatus.committed_index
are increasing but thenodeStatus.known_applied_index
index is just stuck and seems to increase only after every snapshot. During snapshotnodeStatus.known_applied_index
increases, and then after that it is just stuck even as the other two indices increase.Can someone help explain when this can happen? Help needed @PFZheng @Edward-xk @ipconfigme
The text was updated successfully, but these errors were encountered: