Closed hicqu closed 5 years ago
For now if any datacenter fails, we could lost some latest writes if those entries are committed by
A, B, E
orC, D, E
.
This is expected. A witness node doesn't have the actual log, there is a price to pay for that and that price is the reduced availability.
Such reduced availability impact has also been analyzed in details in the context of Raft by the author who first came up with the witness idea. Please see the paper below.
Dragonboat version
master.
Expected behavior
I guess it's better if witnesses won't be count when committing entries.
Suppose we have a Raft group with nodes
A, B, C, D E
.A, B
are in one datacenter andC, D
are in an another one. All of them are voters exceptE
, which is a witness. For now if any datacenter fails, we could lost some latest writes if those entries are committed byA, B, E
orC, D, E
. This problem can be resolved if we don't count witness when trying to commit entries.Actual behavior
Seems in function
tryCommit
, witnesses are counted when committing entries.Steps to reproduce the behavior
Not need. Just read the code is enough.