From 86483f603c2de7ee5ec5f013798d38c770e35859 Mon Sep 17 00:00:00 2001 From: Erwin Pe Date: Tue, 17 May 2022 02:13:51 +0000 Subject: SERVER-65999 Fix the sharding test for two simultaneous compacts (cherry picked from commit a86cebf1f3e71d70d83de592128ada08493321be) --- src/mongo/db/commands/fle2_compact.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mongo/db/commands/fle2_compact.cpp b/src/mongo/db/commands/fle2_compact.cpp index 03fc6c7b0a9..18f1f05cf98 100644 --- a/src/mongo/db/commands/fle2_compact.cpp +++ b/src/mongo/db/commands/fle2_compact.cpp @@ -43,6 +43,10 @@ #include "mongo/platform/mutex.h" #include "mongo/util/fail_point.h" +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kWrite + + +MONGO_FAIL_POINT_DEFINE(fleCompactFailBeforeECOCRead); MONGO_FAIL_POINT_DEFINE(fleCompactHangBeforeESCPlaceholderInsert); MONGO_FAIL_POINT_DEFINE(fleCompactHangAfterESCPlaceholderInsert); MONGO_FAIL_POINT_DEFINE(fleCompactHangBeforeECCPlaceholderInsert); @@ -617,6 +621,10 @@ CompactStats processFLECompact(OperationContext* opCtx, auto eccStats = std::make_shared(); auto c = std::make_shared>(); + if (MONGO_unlikely(fleCompactFailBeforeECOCRead.shouldFail())) { + uasserted(6599901, "Failed compact due to fleCompactFailBeforeECOCRead fail point"); + } + // Read the ECOC documents in a transaction { std::shared_ptr trun = getTxn(opCtx); -- cgit v1.2.1