Skip to content

Commit 5c5e829

Browse files
(2.14) [FIXED] Filestore delete map race
Signed-off-by: Maurice van Veen <[email protected]>
1 parent aa1b2fc commit 5c5e829

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/filestore.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10669,8 +10669,14 @@ func (fs *fileStore) deleteBlocks() DeleteBlocks {
1066910669
// deleteMap returns all interior deletes for each block based on the mb.dmap.
1067010670
// Specifically, this will not contain any deletes for blocks that have been removed.
1067110671
// This is useful to know whether a tombstone is still relevant and marked as deleted by an active block.
10672-
// All blocks should be at least read locked.
10672+
// No locks should be held.
1067310673
func (fs *fileStore) deleteMap() (dmap avl.SequenceSet) {
10674+
fs.mu.RLock()
10675+
defer fs.mu.RUnlock()
10676+
10677+
fs.readLockAllMsgBlocks()
10678+
defer fs.readUnlockAllMsgBlocks()
10679+
1067410680
for _, mb := range fs.blks {
1067510681
if mb.dmap.Size() > 0 {
1067610682
mb.dmap.Range(func(seq uint64) bool {

0 commit comments

Comments
 (0)