Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check refcount in reopen dirty seg (#12207)
This fixes a race condition when merging dirty segs. If the refcount is > 0 we should not remove the seg immediately because there is a visible segment holding a reference. This will get tidied-up when the last visible segment closes and the file is removed. This condition happens in a destructive way after a merge. In this case any new visible segments will be given the newly merged file so will not hold references to this file. I've tested this by running amoy to the chain tip and leaving it running and previous crashes seem to have been tidied up.
- Loading branch information