65
defer m.Unlock()
66
if m.ackLevel == m.readLevel {
67
>
// This is called after we read a range and find no tasks. The range we read was m.readLevel to newReadLevel.
ack_manager.go
68
>
// (We know this because nothing should change m.readLevel except the getTasksPump loop itself, after initialization.
69
>
// And getTasksPump doesn't start until it gets a signal from taskWriter that it's initialized the levels.)
70
>
// If we've acked all tasks up to m.readLevel, and there are no tasks between that and newReadLevel, then we've
71
>
// acked all tasks up to newReadLevel too. This lets us advance the ack level on a task queue with no activity
72
>
// but where the rangeid has moved higher, to prevent excessive reads on the next load.
73
>
m.ackLevel = newReadLevel
74
>
}
75
m.readLevel = newReadLevel
76
}