Mercurial > lbo > hg > clusterconsensus
changeset 28:78f114bfcc9e
Explain durability behavior of Submit*()
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sun, 09 Oct 2016 12:04:34 +0200 |
parents | 52d20e883c79 |
children | 2eac51eadf92 |
files | consensus.go |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/consensus.go Sat Oct 08 16:45:07 2016 +0200 +++ b/consensus.go Sun Oct 09 12:04:34 2016 +0200 @@ -50,6 +50,12 @@ // Submit submits a set of changes to the cluster. Returns nil if successful // Depending on whether this Participant is currently a Master, this will either replicate the change to all // non-master participants or send the change to the master which will then replicate the change. +// +// NOTE -- after this returns, the changes are only fully committed on the master. To achieve full +// commit across all participants, just submit another (set of) change(s), which may be empty. +// In normal operation, if you submit a stream of changes, any change will be committed durably +// across the cluster once the consecutive change has been submitted (this design decision has been +// made for latency/performance reasons) func (p *Participant) Submit(c []Change) error { // 1. Check if we're master