Skip to content

Commit aa92b80

Browse files
committed
sbft: clean up comments and log messages
Change-Id: Ia1639180d6ce3e084fe83f7430d03418bf1cf957 Signed-off-by: Simon Schubert <[email protected]>
1 parent 84d1cb1 commit aa92b80

File tree

5 files changed

+5
-29
lines changed

5 files changed

+5
-29
lines changed

consensus/simplebft/backlog.go

-19
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,4 @@ func (s *SBFT) processBacklog() {
9393
}
9494
}
9595
}
96-
97-
// TODO
98-
//
99-
// Detect when we need to reconsider our options.
100-
//
101-
// We arrived here because either all is fine, we're with the
102-
// pack. Or we have messages in the backlog because we're
103-
// connected asymmetrically, and a close replica already
104-
// started talking about the next batch while we're still
105-
// waiting for rounds to arrive for our current batch. That's
106-
// still fine.
107-
//
108-
// We might also be here because we lost connectivity, and we
109-
// either missed some messages, or our connection is bad and
110-
// we should reconnect to get a working connection going
111-
// again.
112-
//
113-
// Do we need to detect that a connection is stuck and we
114-
// should reconnect?
11596
}

consensus/simplebft/commit.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ func (s *SBFT) handleCommit(c *Subject, src uint64) {
3939
}
4040

4141
if !reflect.DeepEqual(c, &s.cur.subject) {
42-
log.Warningf("commit does not match expected subject %v, got %v", &s.cur.subject, c)
42+
log.Warningf("commit does not match expected subject %v %x, got %v %x",
43+
s.cur.subject.Seq, s.cur.subject.Digest, c.Seq, c.Digest)
4344
return
4445
}
4546
if _, ok := s.cur.commit[src]; ok {

consensus/simplebft/connection.go

-6
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ func (s *SBFT) Connection(replica uint64) {
3838
// Therefore we also send the most recent (pre)prepare,
3939
// commit, checkpoint so that the reconnecting replica can
4040
// catch up on the in-flight batch.
41-
//
42-
// TODO We need to communicate the latest view to the
43-
// connecting replica. The new view message is not signed, so
44-
// we cannot send that message. The worst corner case is
45-
// connecting right after a new-view message was received, and
46-
// its xset batch is in-flight.
4741

4842
batchheader, err := s.checkBatch(&batch, false)
4943
if err != nil {

consensus/simplebft/execute.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (s *SBFT) maybeExecute() {
2121
return
2222
}
2323
s.cur.executed = true
24-
log.Noticef("executing %v", s.cur.subject)
24+
log.Noticef("%d is executing %v %x", s.id, s.cur.subject.Seq, s.cur.subject.Digest)
2525

2626
s.sys.Persist("execute", &s.cur.subject)
2727

consensus/simplebft/simplebft_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ var testLog = logging.MustGetLogger("test")
2929

3030
func init() {
3131
logging.SetLevel(logging.NOTICE, "")
32-
logging.SetLevel(logging.DEBUG, "test")
33-
logging.SetLevel(logging.DEBUG, "sbft")
32+
// logging.SetLevel(logging.DEBUG, "test")
33+
// logging.SetLevel(logging.DEBUG, "sbft")
3434
}
3535

3636
func connectAll(sys *testSystem) {

0 commit comments

Comments
 (0)