From c2ab24378cc8e8e5bdd3d251f31610441b2b3a13 Mon Sep 17 00:00:00 2001 From: Philip O Toole Date: Sat, 24 Dec 2016 09:49:31 -0500 Subject: [PATCH 1/2] Lint fixes --- store/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/store.go b/store/store.go index 5cb1d1bc..f625a3d6 100644 --- a/store/store.go +++ b/store/store.go @@ -683,7 +683,7 @@ func (s *Store) Apply(l *raft.Log) interface{} { } } -// Database() returns a copy of the underlying database. The caller should +// Database returns a copy of the underlying database. The caller should // ensure that no transaction is taking place during this call, or an error may // be returned. // From 098578bda856ed773677a9d445ad4acf80e4208f Mon Sep 17 00:00:00 2001 From: Philip O Toole Date: Sat, 24 Dec 2016 09:53:49 -0500 Subject: [PATCH 2/2] Clarify guarantees of some functions --- store/store.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/store/store.go b/store/store.go index f625a3d6..732a6462 100644 --- a/store/store.go +++ b/store/store.go @@ -485,7 +485,11 @@ func (s *Store) Load(r io.Reader) (int, error) { return len(queries), nil } -// Backup return a consistent snapshot of the underlying database. +// Backup return a snapshot of the underlying database. +// +// If leader is true, this operation is performed with a read consistency +// level equivalent to "weak". Otherwise no guarantees are made about the +// read consistentcy level. func (s *Store) Backup(leader bool) ([]byte, error) { if leader && s.raft.State() != raft.Leader { return nil, ErrNotLeader @@ -685,7 +689,9 @@ func (s *Store) Apply(l *raft.Log) interface{} { // Database returns a copy of the underlying database. The caller should // ensure that no transaction is taking place during this call, or an error may -// be returned. +// be returned. If leader is true, this operation is performed with a read +// consistency level equivalent to "weak". Otherwise no guarantees are made +// about the read consistentcy level. // // http://sqlite.org/howtocorrupt.html states it is safe to do this // as long as no transaction is in progress.