Skip to content

Commit

Permalink
sbft: clean up comments and log messages
Browse files Browse the repository at this point in the history
Change-Id: Ia1639180d6ce3e084fe83f7430d03418bf1cf957
Signed-off-by: Simon Schubert <sis@zurich.ibm.com>
  • Loading branch information
corecode committed Nov 3, 2016
1 parent 84d1cb1 commit aa92b80
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 29 deletions.
19 changes: 0 additions & 19 deletions consensus/simplebft/backlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,4 @@ func (s *SBFT) processBacklog() {
}
}
}

// TODO
//
// Detect when we need to reconsider our options.
//
// We arrived here because either all is fine, we're with the
// pack. Or we have messages in the backlog because we're
// connected asymmetrically, and a close replica already
// started talking about the next batch while we're still
// waiting for rounds to arrive for our current batch. That's
// still fine.
//
// We might also be here because we lost connectivity, and we
// either missed some messages, or our connection is bad and
// we should reconnect to get a working connection going
// again.
//
// Do we need to detect that a connection is stuck and we
// should reconnect?
}
3 changes: 2 additions & 1 deletion consensus/simplebft/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ func (s *SBFT) handleCommit(c *Subject, src uint64) {
}

if !reflect.DeepEqual(c, &s.cur.subject) {
log.Warningf("commit does not match expected subject %v, got %v", &s.cur.subject, c)
log.Warningf("commit does not match expected subject %v %x, got %v %x",
s.cur.subject.Seq, s.cur.subject.Digest, c.Seq, c.Digest)
return
}
if _, ok := s.cur.commit[src]; ok {
Expand Down
6 changes: 0 additions & 6 deletions consensus/simplebft/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ func (s *SBFT) Connection(replica uint64) {
// Therefore we also send the most recent (pre)prepare,
// commit, checkpoint so that the reconnecting replica can
// catch up on the in-flight batch.
//
// TODO We need to communicate the latest view to the
// connecting replica. The new view message is not signed, so
// we cannot send that message. The worst corner case is
// connecting right after a new-view message was received, and
// its xset batch is in-flight.

batchheader, err := s.checkBatch(&batch, false)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion consensus/simplebft/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (s *SBFT) maybeExecute() {
return
}
s.cur.executed = true
log.Noticef("executing %v", s.cur.subject)
log.Noticef("%d is executing %v %x", s.id, s.cur.subject.Seq, s.cur.subject.Digest)

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

Expand Down
4 changes: 2 additions & 2 deletions consensus/simplebft/simplebft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var testLog = logging.MustGetLogger("test")

func init() {
logging.SetLevel(logging.NOTICE, "")
logging.SetLevel(logging.DEBUG, "test")
logging.SetLevel(logging.DEBUG, "sbft")
// logging.SetLevel(logging.DEBUG, "test")
// logging.SetLevel(logging.DEBUG, "sbft")
}

func connectAll(sys *testSystem) {
Expand Down

0 comments on commit aa92b80

Please sign in to comment.