Skip to content

Commit

Permalink
MB-50034: Potential deadlock in MOI.doPersistSnapshot
Browse files Browse the repository at this point in the history
RWMutex RUnlock call is missing. This is a regression introduced with MB-46507 [Backport] - [System test Upgrade] - Negative values returned for stat raw_data_size post upgrade
Due to missing unlock index main loop will get stuck and cause multiple issues such as failed rebalance, indexer flush stuck etc.
Fix: release acquired mutex.

Change-Id: I3c934654e16d874a46fe536a507034bae27f6545
  • Loading branch information
Yogendra Acharya committed Dec 10, 2021
1 parent 4c2a7fa commit 1eea12d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions secondary/indexer/memdb_slice_impl.go
Expand Up @@ -963,6 +963,7 @@ func (mdb *memdbSlice) doPersistSnapshot(s *memdbSnapshot) {
os.RemoveAll(tmpdir)
mdb.confLock.RLock()
maxThreads := mdb.sysconf["settings.moi.persistence_threads"].Int()
mdb.confLock.RUnlock()
total := atomic.LoadInt64(&totalMemDBItems)
indexCount := mdb.GetCommittedCount()
// Compute number of workers to be used for taking backup
Expand Down

0 comments on commit 1eea12d

Please sign in to comment.