From 067159eeab106f4d88dad3aca67ba6cea97b3793 Mon Sep 17 00:00:00 2001 From: Radu Berinde Date: Tue, 30 Jan 2024 06:09:54 -0800 Subject: [PATCH] db: remove panic when cleanup jobs queue is full This assertion was hit while stress-testing `TestIteratorErrors`. It is not necessary, since the code is designed to block as needed. It was there to make sure we never block under normal circumstances. --- cleaner.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cleaner.go b/cleaner.go index 1f9262e58a..e2fa215029 100644 --- a/cleaner.go +++ b/cleaner.go @@ -12,7 +12,6 @@ import ( "github.com/cockroachdb/errors/oserror" "github.com/cockroachdb/pebble/internal/base" - "github.com/cockroachdb/pebble/internal/invariants" "github.com/cockroachdb/pebble/objstorage" "github.com/cockroachdb/tokenbucket" ) @@ -123,10 +122,6 @@ func (cm *cleanupManager) EnqueueJob(jobID int, obsoleteFiles []obsoleteFile) { cm.maybeLogLocked() cm.mu.Unlock() - if invariants.Enabled && len(cm.jobsCh) >= cap(cm.jobsCh)-2 { - panic("cleanup jobs queue full") - } - cm.jobsCh <- job }