diff options
author | Louis Williams <louis.williams@mongodb.com> | 2020-09-30 14:14:01 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-10-01 22:07:02 +0000 |
commit | 00cc67fc18f2ef81a2d08d962eca1f2907e3b51e (patch) | |
tree | 4efc31b9ed003da5aae9d3838dd513cb9cc5de11 /src/mongo/db/catalog/index_catalog_entry.h | |
parent | fa5aff14111de4fe23ae0094c597673cc4a48d3b (diff) | |
download | mongo-00cc67fc18f2ef81a2d08d962eca1f2907e3b51e.tar.gz |
SERVER-51228 dbHash should return SnapshotUnavailable if the _id index is not visible or ready
Diffstat (limited to 'src/mongo/db/catalog/index_catalog_entry.h')
-rw-r--r-- | src/mongo/db/catalog/index_catalog_entry.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/index_catalog_entry.h b/src/mongo/db/catalog/index_catalog_entry.h index 8abc7000fdb..e34deceab01 100644 --- a/src/mongo/db/catalog/index_catalog_entry.h +++ b/src/mongo/db/catalog/index_catalog_entry.h @@ -137,10 +137,26 @@ public: const KeyStringSet& multikeyMetadataKeys, const MultikeyPaths& multikeyPaths) = 0; - // if this ready is ready for queries + /** + * Returns whether this index is ready for queries. This is potentially unsafe in that it does + * not consider whether the index is visible or ready in the currently storage snapshot. For + * that, use isReadyInMySnapshot() or isPresentInMySnapshot(). + */ virtual bool isReady(OperationContext* const opCtx) const = 0; /** + * Safely check whether this index is visible in the durable catalog in the current storage + * engine snapshot. + */ + virtual bool isPresentInMySnapshot(OperationContext* opCtx) const = 0; + + /** + * Safely check whether this index is visible and ready in the durable catalog in the current + * storage engine snapshot. + */ + virtual bool isReadyInMySnapshot(OperationContext* opCtx) const = 0; + + /** * Returns true if this index is not ready, and it is not currently in the process of being * built either. */ |