[BP 7.0.2 MB-47749] - handleIndexMergeSnapshot() panic from extraneous s.muSnap.Unlock() calls

Description

secondary/indexer/storage_manager.go handleIndexMergeSnapshot() does not lock, and its caller does not hold, the s.muSnap mutex (apparently it used to lock this at the top), but it still contains rarely-entered error reporting code blocks that unlock this mutex. If one of these error blocks gets entered, it triggers a panic.

The fix is to delete the s.muSnap.Unlock() calls from this method. There are three of them (one is in commented-out code and two are in live code).
 

Seen in currently undelivered new version of set14_rebalance_test.go TestFailoverAndRebalance:
http://ci2i-unstable.northscale.in/gsi-04.08.2021-09.40.fail.html

Components

Affects versions

Fix versions

Labels

Environment

None

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Hemant Rajput August 19, 2021 at 5:10 AM

Closing the ticket based on Kevin's comment

Kevin Cherkauer August 18, 2021 at 7:19 PM

As luck would have it, the CI Bot run

  http://ci2i-unstable.northscale.in/gsi-17.08.2021-10.31.fail.html

hit the same issue in rebalance, but with this fix already in place, and therefore it returned the following error message instead of panicking on mutex unlock:

Also I verified from code inspection that the fix removed the mutex Unlock() call that threw the panic before.

So you can close this.

 

 

Hemant Rajput August 18, 2021 at 9:31 AM

, can you please provide steps to validate this ticket? It doesn't look like verifiable using functional test.

CB robot August 5, 2021 at 9:29 PM

Build couchbase-server-7.0.1-5990 contains indexing commit 6e28177 with commit message:
Delete s.muSnap.Unlock() calls from handleIndexMergeSnapshot()

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Is this a Regression?

Unknown

Triage

Untriaged

Story Points

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created August 5, 2021 at 10:35 AM
Updated August 19, 2021 at 5:10 AM
Resolved August 5, 2021 at 5:15 PM
Instabug