summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2021-02-22 17:17:12 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-24 00:02:06 +0000
commit24a71228f4bf3ca9051b72f0777bae2286e7182a (patch)
tree40300b72b0a8270de29abc14aea3608f7b23a549 /src/mongo
parent0e1b1f4789c398045052d24f8cceada5e72ed757 (diff)
downloadmongo-24a71228f4bf3ca9051b72f0777bae2286e7182a.tar.gz
SERVER-54717 Fix failing ephemeralForTest clustered index ValidateTests
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/dbtests/validate_tests.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mongo/dbtests/validate_tests.cpp b/src/mongo/dbtests/validate_tests.cpp
index 35a2af2b2ac..e7e5e1b5818 100644
--- a/src/mongo/dbtests/validate_tests.cpp
+++ b/src/mongo/dbtests/validate_tests.cpp
@@ -73,8 +73,11 @@ public:
auto db = autoDb.getDb();
ASSERT_TRUE(db);
+ _supportsClusteredIdIndex =
+ _opCtx.getServiceContext()->getStorageEngine()->supportsClusteredIdIndex();
+
CollectionOptions options;
- if (clustered) {
+ if (clustered && _supportsClusteredIdIndex) {
options.clusteredIndex = ClusteredIndexOptions{};
}
@@ -191,6 +194,7 @@ protected:
Database* _db;
bool _isInRecordIdOrder;
bool _engineSupportsCheckpoints;
+ bool _supportsClusteredIdIndex;
};
template <bool full, bool background>
@@ -3517,6 +3521,10 @@ public:
: ValidateBase(/*full=*/false, background, /*clustered=*/true) {}
void run() {
+ if (!_supportsClusteredIdIndex) {
+ return;
+ }
+
// Cannot run validate with {background:true} if either
// - the RecordStore cursor does not retrieve documents in RecordId order
// - or the storage engine does not support checkpoints.
@@ -3582,6 +3590,10 @@ public:
: ValidateBase(/*full=*/false, background, /*clustered=*/true) {}
void run() {
+ if (!_supportsClusteredIdIndex) {
+ return;
+ }
+
// Cannot run validate with {background:true} if either
// - the RecordStore cursor does not retrieve documents in RecordId order
// - or the storage engine does not support checkpoints.
@@ -3682,6 +3694,10 @@ public:
: ValidateBase(/*full=*/false, /*background=*/false, /*clustered=*/true) {}
void run() {
+ if (!_supportsClusteredIdIndex) {
+ return;
+ }
+
// Cannot run validate with {background:true} if either
// - the RecordStore cursor does not retrieve documents in RecordId order
// - or the storage engine does not support checkpoints.