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.
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.