mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: add more detailed traces on linearized reading (#12335)
To improve debuggability of `agreement among raft nodes before linearized reading`, we added some tracing inside `linearizableReadLoop`. This will allow us to know the timing of `s.r.ReadIndex` vs `s.applyWait.Wait(rs.Index)`.
This commit is contained in:
@@ -157,6 +157,13 @@ func (t *Trace) LogIfLong(threshold time.Duration) {
|
||||
}
|
||||
}
|
||||
|
||||
// LogAllStepsIfLong dumps all logs if the duration is longer than threshold
|
||||
func (t *Trace) LogAllStepsIfLong(threshold time.Duration) {
|
||||
if time.Since(t.startTime) > threshold {
|
||||
t.LogWithStepThreshold(0)
|
||||
}
|
||||
}
|
||||
|
||||
// LogWithStepThreshold only dumps step whose duration is longer than step threshold
|
||||
func (t *Trace) LogWithStepThreshold(threshold time.Duration) {
|
||||
msg, fs := t.logInfo(threshold)
|
||||
|
||||
Reference in New Issue
Block a user