summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/index_catalog_entry.h
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2020-09-30 14:14:01 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-01 22:07:02 +0000
commit00cc67fc18f2ef81a2d08d962eca1f2907e3b51e (patch)
tree4efc31b9ed003da5aae9d3838dd513cb9cc5de11 /src/mongo/db/catalog/index_catalog_entry.h
parentfa5aff14111de4fe23ae0094c597673cc4a48d3b (diff)
downloadmongo-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.h18
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.
*/