cloud-software-foundation / c5

c5
Apache License 2.0
12 stars 8 forks source link

Follower nodes need to emit data they have committed #283

Open joshua-g opened 10 years ago

joshua-g commented 10 years ago

Currently, interface Replicator emits "commit notices" when it has committed an entry. The notice just indicates which sequence numbers have been committed. It emits this notice regardless of whether the Replicator is in leader or follower state. Although there is symmetry between those two roles at this layer, the symmetry is broken at the layer where the Replicator is actually used. Users want to use leaders and followers in two different ways:

Someone using a leader node expects it to be able to accept data and return a notification when the write has "gone through", that is, in Raft lingo, been committed.

But someone using a follower node expects it to emit a stream of committed data. This functionality needs to exist. There should be a new method on interface GeneralizedReplicator that describes this functionality, and it should be implemented in C5GeneralizedReplicator.

Emitted data is a replicator-level concept, not a log-level concept, because it must not include control data that is present in the log.