Skip to content

Commit 1e550db

Browse files
committed
PSMDB-1831 restore call to stopStorageControls during _switchStorageLocation
Before commit 41e93e3 (SERVER-103812) stopStorageControls was called automatically via: reinitializeStorageEngine -> shutdownGlobalStorageEngineCleanly -> stopStorageControls That commit removed stopStorageCaontrols call from shutdownGlobalStorageEngineCleanly so we need to call it from _switchStorageLocation before reinitializeStorageEngine
1 parent 06de56b commit 1e550db

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

src/mongo/db/repl/initial_sync/initial_syncer_fcb.cpp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,8 @@ Copyright (C) 2024-present Percona and/or its affiliates. All rights reserved.
2929
it in the license file.
3030
======= */
3131

32-
#include <algorithm>
33-
#include <array>
34-
#include <cstdint>
35-
#include <functional>
36-
#include <memory>
37-
#include <type_traits>
38-
#include <utility>
39-
4032
#include "initial_syncer_fcb.h"
4133

42-
#include <boost/filesystem.hpp>
43-
#include <boost/optional.hpp>
44-
#include <fmt/format.h>
45-
4634
#include "mongo/base/error_codes.h"
4735
#include "mongo/base/status.h"
4836
#include "mongo/base/string_data.h"
@@ -91,6 +79,7 @@ Copyright (C) 2024-present Percona and/or its affiliates. All rights reserved.
9179
#include "mongo/db/server_recovery.h"
9280
#include "mongo/db/service_context.h"
9381
#include "mongo/db/startup_recovery.h"
82+
#include "mongo/db/storage/control/storage_control.h"
9483
#include "mongo/db/storage/storage_engine.h"
9584
#include "mongo/db/storage/storage_engine_init.h"
9685
#include "mongo/db/storage/storage_options.h"
@@ -117,6 +106,18 @@ Copyright (C) 2024-present Percona and/or its affiliates. All rights reserved.
117106
#include "mongo/util/timer.h"
118107
#include "mongo/util/version/releases.h"
119108

109+
#include <algorithm>
110+
#include <array>
111+
#include <cstdint>
112+
#include <functional>
113+
#include <memory>
114+
#include <type_traits>
115+
#include <utility>
116+
117+
#include <boost/filesystem.hpp>
118+
#include <boost/optional.hpp>
119+
#include <fmt/format.h>
120+
120121
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kReplicationInitialSync
121122

122123

@@ -1714,6 +1715,13 @@ Status InitialSyncerFCB::_switchStorageLocation(OperationContext* opCtx,
17141715
<< " Error: " << ec.message()};
17151716
}
17161717

1718+
// Shut down JournalFlusher
1719+
// startStorageControls is called by reinitializeStorageEngine below
1720+
StorageControl::stopStorageControls(
1721+
opCtx->getServiceContext(),
1722+
{ErrorCodes::InterruptedDueToStorageChange, "Interrupted due to storage change"},
1723+
/*forRestart=*/false);
1724+
17171725
auto previousCatalogState = catalog::closeCatalog(opCtx);
17181726

17191727
auto lastShutdownState =

0 commit comments

Comments
 (0)