Skip to content
Snippets Groups Projects
Unverified Commit 740396be authored by Manish R Jain's avatar Manish R Jain
Browse files

Track latency of raft.Advance. Also, wait a bit more during infinite retry in live loader.

parent c717e6de
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,7 @@ func handleError(err error) {
func (l *loader) infinitelyRetry(req api.Mutation) {
defer l.retryRequestsWg.Done()
for {
for i := time.Millisecond; ; i *= 2 {
txn := l.dc.NewTxn()
req.CommitNow = true
_, err := txn.Mutate(l.opts.Ctx, &req)
......@@ -139,7 +139,10 @@ func (l *loader) infinitelyRetry(req api.Mutation) {
}
handleError(err)
atomic.AddUint64(&l.aborts, 1)
time.Sleep(10 * time.Millisecond)
if i >= 10*time.Second {
i = 10 * time.Second
}
time.Sleep(i)
}
}
......
......@@ -805,15 +805,19 @@ func (n *node) Run() {
n.Send(msg)
}
}
timer.Record() // Index 4.
n.Raft().Advance()
if firstRun && n.canCampaign {
go n.Raft().Campaign(n.ctx)
firstRun = false
}
timer.Record() // Index 4.
if total := timer.Total(); total >= 100*time.Millisecond {
elog.Printf("Timer Total: %v. All: %+v.", total, timer.All())
timer.Record() // Index 5. Largely tracks Raft().Advance().
total := timer.Total()
all := timer.All()
if total >= 100*time.Millisecond || all[3] >= 10*time.Millisecond {
elog.Printf("Timer Total: %v. All: %+v.", total, all)
}
case <-n.stop:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment