Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

[WIP] order: completely refactor the code #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[WIP] order: completely refactor the code #31

wants to merge 2 commits into from

Conversation

ccding
Copy link

@ccding ccding commented Jun 12, 2019

No description provided.

viewMu: sync.RWMutex{},
forwardC: make(chan *orderpb.ReportRequest),
mu sync.RWMutex
leaderMu sync.RWMutex

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))

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

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) {

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() {

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)

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},

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)}

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants