Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.17.0
-
None
-
None
Description
After a write operation (append/truncate) is discarded (e.g. due to timeout), the log coordinator should demoted itself, because it does not know if the previous write operation has been agreed or not. It needs to get re-elected to be able to write again.
Consider the following case: there are 3 replicas R1, R2 and R3, and C1 is the coordinator co-located with R1. Say C1 tries to write at position 1. All replicas receive the write request and accept the write request. C1 successfully collects a quorum of OK responses, and right before it sends out the learned message, the write operation is discarded.
The value at position 1 has been agreed, however, if we don't demote C1 after the write operation is discarded, C1 will try to write to the same position (position 1) again, with possibly a different value. And that value can be later agreed by all replicas, leading to an inconsistency.