diff --git a/pkg/kv/kvclient/kvstreamer/requests_provider.go b/pkg/kv/kvclient/kvstreamer/requests_provider.go index 14efdd53ab6b..6f1baf680cb3 100644 --- a/pkg/kv/kvclient/kvstreamer/requests_provider.go +++ b/pkg/kv/kvclient/kvstreamer/requests_provider.go @@ -264,6 +264,9 @@ func (p *outOfOrderRequestsProvider) enqueue(requests []singleRangeBatch) { if len(p.requests) > 0 { panic(errors.AssertionFailedf("outOfOrderRequestsProvider has old requests in enqueue")) } + if len(requests) == 0 { + panic(errors.AssertionFailedf("outOfOrderRequestsProvider enqueuing zero requests")) + } p.requests = requests p.hasWork.Signal() } @@ -388,6 +391,9 @@ func (p *inOrderRequestsProvider) enqueue(requests []singleRangeBatch) { if len(p.requests) > 0 { panic(errors.AssertionFailedf("inOrderRequestsProvider has old requests in enqueue")) } + if len(requests) == 0 { + panic(errors.AssertionFailedf("inOrderRequestsProvider enqueuing zero requests")) + } p.requests = requests p.heapInit() p.hasWork.Signal()