Open bananabrick opened 2 years ago
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to Pebble!
If the
WaitGroup
counter is at0
, thenWaitGroup.Add
must be called beforeWaitGroup.Wait
is called, see: https://pkg.go.dev/sync#WaitGroup.Add.In our code, we call
deleters.Add
, here: https://github.com/cockroachdb/pebble/blob/master/compaction.go#L2821.And we wait, here: https://github.com/cockroachdb/pebble/blob/master/db.go#L1016.
But,
DB.Close
could be called beforeAdd
is ever called. Before we calldeleters.Wait
inDB.Close
, we do callDB.deleteObsoleteFiles
, here: https://github.com/cockroachdb/pebble/blob/master/db.go#L1012, which may calldeleters.Add
, here: https://github.com/cockroachdb/pebble/blob/master/compaction.go#L2821, but only if there exist files to delete, https://github.com/cockroachdb/pebble/blob/master/compaction.go#L2820.Seems pretty minor and maybe I'm missing an invariant which prevents this.
Jira issue: PEBBLE-204