Skip to content

Commit

Permalink
MB-45990 (7.1.0 1910) Active indexes reported building in system_indexes
Browse files Browse the repository at this point in the history
Fixes a problem where metadataClient's cached slice of scheduled plus
existing indexes can be stale but it does not notice because the cache-
invalidating changes are not synced with cache invalidation itself. This
could lead to indexes showing as "building" forever in metadataClient
output because it missed a cache-invalidating event and kept returning
a stale cached list of scheduled plus existing indexes.

The replacement algorithm requires all changes to
  1. indexers.allIndexes[] -- all currently existing indexes
  2. schedTokenMon.scheduledIndexes[] -- all currently scheduled indexes
  3. comboIndexes[] -- cached combination of #1 and #2
to be done inside a new mutex, comboIndexesMut. Additionally, the cache
must be invalidated (by setting comboIndexes = nil) inside the same
instance of locking comboIndexesMut as any change to allIndexes or
scheduledIndexes. These behaviors maintain the cache coherency of
comboIndexes by ensuring that whenever it is computed, its content is
in sync with both of its inputs (#1 and #2), and whenever one of its
inputs is changed, comboIndexes gets set back to nil in the same
critical section so cache-invalidating changes can never be missed.

Change-Id: I64ab1a743fec76acb2e969089412039337382f33
  • Loading branch information
cherkauer-couchbase committed Jan 5, 2022
1 parent 3e1dff8 commit 37f7e94
Showing 1 changed file with 151 additions and 160 deletions.
Loading

0 comments on commit 37f7e94

Please sign in to comment.