Skip to content

Commit

Permalink
chore(alpha): add logs for processing entries in applyCh (#8930)
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 authored and jbhamra1 committed Aug 17, 2023
1 parent 7e17d59 commit cd403db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions worker/draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,14 @@ func (n *node) applyMutations(ctx context.Context, proposal *pb.Proposal) (rerr
}

func (n *node) applyCommitted(proposal *pb.Proposal, key uint64) error {
start := time.Now()
defer func() {
since := time.Since(start)
if since > 30*time.Second {
glog.Warningf("applyCh entry took [%v] to handle: %#v", since, proposal)
}
}()

ctx := n.Ctx(key)
span := otrace.FromContext(ctx)
span.Annotatef(nil, "node.applyCommitted Node id: %d. Group id: %d. Got proposal key: %d",
Expand Down Expand Up @@ -726,6 +734,9 @@ func (n *node) processApplyCh() {

// This function must be run serially.
handle := func(entries []raftpb.Entry) {
glog.V(3).Infof("handling element in applyCh with #entries %v", len(entries))
defer glog.V(3).Infof("done handling element in applyCh")

var totalSize int64
for _, entry := range entries {
x.AssertTrue(len(entry.Data) > 0)
Expand Down

0 comments on commit cd403db

Please sign in to comment.