Skip to content

High Level Design Docs #1

Closed
deepkaran wants to merge 5 commits intocouchbase:masterfrom
deepkaran:master
Closed

High Level Design Docs #1
deepkaran wants to merge 5 commits intocouchbase:masterfrom
deepkaran:master

Conversation

@deepkaran
Copy link
Copy Markdown
Contributor

No description provided.

@deepkaran deepkaran closed this Mar 6, 2014
ns-codereview pushed a commit that referenced this pull request Feb 26, 2015
FC Build Candidate #1

Change-Id: I52da193d774bbe6d3d7ae2685b38818a562d2a6d
ns-codereview pushed a commit that referenced this pull request Jan 5, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant