Skip to content

Commit 36bb0aa

Browse files
committed
kvstreamer: fix up some comments
As of d564a0c we no longer use FIFO order in the OutOfOrder requests provider, so this commit adjusts the comments accordingly. Release note: None
1 parent 618c73a commit 36bb0aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/kv/kvclient/kvstreamer/requests_provider.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ func (b *requestsProviderBase) close() {
244244
}
245245

246246
// outOfOrderRequestsProvider is a requestProvider that returns requests in an
247-
// arbitrary order (namely in the same order as the requests are enqueued and
248-
// added).
247+
// arbitrary order (namely in the LIFO order of requests being enqueued).
249248
type outOfOrderRequestsProvider struct {
250249
*requestsProviderBase
251250
}
@@ -283,6 +282,8 @@ func (p *outOfOrderRequestsProvider) nextLocked() singleRangeBatch {
283282
if len(p.requests) == 0 {
284283
panic(errors.AssertionFailedf("nextLocked called when requestsProvider is empty"))
285284
}
285+
// Use the last request so that we could reuse its slot if resume request is
286+
// added.
286287
return p.requests[len(p.requests)-1]
287288
}
288289

@@ -291,6 +292,8 @@ func (p *outOfOrderRequestsProvider) removeNextLocked() {
291292
if len(p.requests) == 0 {
292293
panic(errors.AssertionFailedf("removeNextLocked called when requestsProvider is empty"))
293294
}
295+
// Use the last request so that we could reuse its slot if resume request is
296+
// added.
294297
p.requests = p.requests[:len(p.requests)-1]
295298
}
296299

0 commit comments

Comments
 (0)