diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2020-04-24 09:59:05 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-24 14:11:41 +0000 |
commit | 3566db153ea61fb10d3ef11ea917fc7bc93eac4d (patch) | |
tree | 955fe2a45da2f5d7b885c197a7930815a447000b /src/mongo/db/multi_key_path_tracker.h | |
parent | 60ed56e7246f862c5874f6c346d1b1ec6bc948a8 (diff) | |
download | mongo-3566db153ea61fb10d3ef11ea917fc7bc93eac4d.tar.gz |
SERVER-47694: fix multikey. again
Split the single _isMultikey variable on an IndexCatalogEntry(Impl) into two
separate variables: _isMultikeyForReader and _isMultikeyForWriter.
_isMultikeyForReader is flipped as early as possible. Readers concurrent
with multikey flipping may forgo a possible optimization when their snapshot
sees no multikey data.
_isMultikeyForWriter is flipped after the storage engine commits a multikey
change to the on-disk catalog. At this point, writers may, under some
circumstances, optimize away some catalog writes.
Move logic for optimizing readers (multikey paths, clearing query cache) outside
of the onCommit.
Adds a failpoint widenWUOWChangesWindow which sleeps transaction commit and
onCommit/onRollback handlers.
Have validate assert multikey paths are set correctly for the documents observed
during its collection scan.
Diffstat (limited to 'src/mongo/db/multi_key_path_tracker.h')
-rw-r--r-- | src/mongo/db/multi_key_path_tracker.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/multi_key_path_tracker.h b/src/mongo/db/multi_key_path_tracker.h index b155bc1fe58..d6efe1e71db 100644 --- a/src/mongo/db/multi_key_path_tracker.h +++ b/src/mongo/db/multi_key_path_tracker.h @@ -69,6 +69,11 @@ public: */ static bool isMultikeyPathsTrivial(const MultikeyPaths& paths); + /** + * Return true iff the child's paths are a subset of the parent. + */ + static bool covers(const MultikeyPaths& parent, const MultikeyPaths& child); + // Decoration requires a default constructor. MultikeyPathTracker() = default; |