summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErwin Pe <erwin.pe@mongodb.com>2022-02-12 03:55:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-12 04:23:25 +0000
commitce43fa5df1f9756219376f49df02bfd2533e8c91 (patch)
tree24c0cde68be273aa03ffe42616b09b79773de1e4 /src
parent02fb1548e140b00734834bd3b624f31826ff3c74 (diff)
downloadmongo-ce43fa5df1f9756219376f49df02bfd2533e8c91.tar.gz
SERVER-63199 Guard fle2 compact with feature flag & skip commands test unless on a replica set
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/commands/SConscript1
-rw-r--r--src/mongo/db/commands/fle2_compact.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index dd18f866d11..b282c413d63 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -232,6 +232,7 @@ env.Library(
'fle2_compact.idl',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/crypto/encrypted_field_config',
'$BUILD_DIR/mongo/db/catalog/catalog_helpers',
'$BUILD_DIR/mongo/db/catalog_raii',
'$BUILD_DIR/mongo/db/commands',
diff --git a/src/mongo/db/commands/fle2_compact.cpp b/src/mongo/db/commands/fle2_compact.cpp
index 9b8c21a2b14..017b5840407 100644
--- a/src/mongo/db/commands/fle2_compact.cpp
+++ b/src/mongo/db/commands/fle2_compact.cpp
@@ -33,6 +33,7 @@
#include "mongo/db/commands/fle2_compact.h"
+#include "mongo/crypto/encryption_fields_gen.h"
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/catalog/rename_collection.h"
#include "mongo/db/catalog_raii.h"
@@ -155,6 +156,8 @@ StatusWith<CompactStats> compactEncryptedCompactionCollection(
return Status(ErrorCodes::NamespaceNotFound, "collection does not exist");
}
+ uassert(6319903, "Feature flag FLE2 is not enabled", gFeatureFlagFLE2.isEnabledAndIgnoreFCV());
+
auto swNamespaces = EncryptedStateCollectionsNamespaces::createFromDataCollection(*edc.get());
if (!swNamespaces.isOK()) {
return swNamespaces.getStatus();