-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] order: completely refactor the code #31
base: master
Are you sure you want to change the base?
Conversation
viewMu: sync.RWMutex{}, | ||
forwardC: make(chan *orderpb.ReportRequest), | ||
mu sync.RWMutex | ||
leaderMu sync.RWMutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaderMu
is unused (from structcheck
)
continue | ||
} | ||
rc.node.Propose(context.TODO(), propB) | ||
rc.node.Propose(context.TODO(), []byte(prop)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of rc.node.Propose
is not checked (from errcheck
)
entry.FinalizeShards = fe | ||
s.proposeC <- entry.String() | ||
case <-ticker.C: | ||
if s.rc.isLeader() { // compute minimum cut and propose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SA9003: empty branch (from staticcheck
)
} | ||
// Overwrites current s data with state data. | ||
// NOTE: assumes that shardIds and numServersPerShard do not change. If they change, then we must recreate channels. | ||
func (s *OrderServer) loadState(state OrderServerState) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
U1000: func (*OrderServer).loadState
is unused (from unused
)
func (server *orderServer) attemptRecoverFromSnapshot() { | ||
snapshot, err := server.rc.snapshotter.Load() | ||
// Use snapshot to reload s state. | ||
func (s *OrderServer) attemptRecoverFromSnapshot() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
U1000: func (*OrderServer).attemptRecoverFromSnapshot
is unused (from unused
)
} | ||
sent = cut | ||
stream.Send(reportReq) | ||
stream.Send(lcs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of stream.Send
is not checked (from errcheck
)
@@ -119,7 +118,7 @@ func newDataServer(replicaID, shardID int32, replicaCount int) *dataServer { | |||
replicaCount: replicaCount, | |||
shardID: shardID, | |||
viewMu: sync.RWMutex{}, | |||
lastCommittedCut: make(order.CommittedCut), | |||
lastCommittedCut: orderpb.CommittedCut{0, nil}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composites: github.com/scalog/scalog/order/orderpb.CommittedCut
composite literal uses unkeyed fields (from govet
)
}, | ||
}, | ||
}, | ||
lcs := &orderpb.LocalCuts{make([]*orderpb.LocalCut, 1)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composites: github.com/scalog/scalog/order/orderpb.LocalCuts
composite literal uses unkeyed fields (from govet
)
No description provided.