diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
| commit | 4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch) | |
| tree | 1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/db/s/migration_chunk_cloner_source.cpp | |
| parent | aa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff) | |
| parent | 8f0827553e09872941945a093b647a4211a9db7f (diff) | |
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0'
with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/db/s/migration_chunk_cloner_source.cpp')
| -rw-r--r-- | src/mongo/db/s/migration_chunk_cloner_source.cpp | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/mongo/db/s/migration_chunk_cloner_source.cpp b/src/mongo/db/s/migration_chunk_cloner_source.cpp index b2bbb68cdb1..6df6ebadd6f 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source.cpp @@ -27,87 +27,14 @@ * it in the license file. */ - -#include "mongo/bson/bsonobj.h" #include "mongo/platform/basic.h" #include "mongo/db/s/migration_chunk_cloner_source.h" - -#include "mongo/db/concurrency/locker.h" -#include "mongo/db/s/collection_sharding_runtime.h" -#include "mongo/db/s/migration_source_manager.h" - namespace mongo { MigrationChunkClonerSource::MigrationChunkClonerSource() = default; MigrationChunkClonerSource::~MigrationChunkClonerSource() = default; -LogInsertForShardingHandler::LogInsertForShardingHandler(OperationContext* opCtx, - NamespaceString nss, - BSONObj doc, - repl::OpTime opTime) - : _opCtx(opCtx), _nss(std::move(nss)), _doc(doc.getOwned()), _opTime(std::move(opTime)) {} - -void LogInsertForShardingHandler::commit(boost::optional<Timestamp>) { - // TODO (SERVER-71444): Fix to be interruptible or document exception. - UninterruptibleLockGuard noInterrupt(_opCtx->lockState()); // NOLINT. - - auto csr = CollectionShardingRuntime::get(_opCtx, _nss); - auto csrLock = CollectionShardingRuntime::CSRLock::lockShared(_opCtx, csr); - - if (auto cloner = MigrationSourceManager::getCurrentCloner(csr, csrLock)) { - cloner->onInsertOp(_opCtx, _doc, _opTime); - } -} - -LogUpdateForShardingHandler::LogUpdateForShardingHandler(OperationContext* opCtx, - NamespaceString nss, - boost::optional<BSONObj> preImageDoc, - BSONObj postImageDoc, - repl::OpTime opTime, - repl::OpTime prePostImageOpTime) - : _opCtx(opCtx), - _nss(std::move(nss)), - _preImageDoc(preImageDoc ? preImageDoc->getOwned() : boost::optional<BSONObj>(boost::none)), - _postImageDoc(postImageDoc.getOwned()), - _opTime(std::move(opTime)), - _prePostImageOpTime(std::move(prePostImageOpTime)) {} - -void LogUpdateForShardingHandler::commit(boost::optional<Timestamp>) { - // TODO (SERVER-71444): Fix to be interruptible or document exception. - UninterruptibleLockGuard noInterrupt(_opCtx->lockState()); // NOLINT. - - auto csr = CollectionShardingRuntime::get(_opCtx, _nss); - auto csrLock = CollectionShardingRuntime::CSRLock::lockShared(_opCtx, csr); - - if (auto cloner = MigrationSourceManager::getCurrentCloner(csr, csrLock)) { - cloner->onUpdateOp(_opCtx, _preImageDoc, _postImageDoc, _opTime, _prePostImageOpTime); - } -} - -LogDeleteForShardingHandler::LogDeleteForShardingHandler(OperationContext* opCtx, - NamespaceString nss, - repl::DocumentKey documentKey, - repl::OpTime opTime, - repl::OpTime prePostImageOpTime) - : _opCtx(opCtx), - _nss(std::move(nss)), - _documentKey(std::move(documentKey)), - _opTime(std::move(opTime)), - _prePostImageOpTime(std::move(prePostImageOpTime)) {} - -void LogDeleteForShardingHandler::commit(boost::optional<Timestamp>) { - // TODO (SERVER-71444): Fix to be interruptible or document exception. - UninterruptibleLockGuard noInterrupt(_opCtx->lockState()); // NOLINT. - - auto csr = CollectionShardingRuntime::get(_opCtx, _nss); - auto csrLock = CollectionShardingRuntime::CSRLock::lockShared(_opCtx, csr); - - if (auto cloner = MigrationSourceManager::getCurrentCloner(csr, csrLock)) { - cloner->onDeleteOp(_opCtx, _documentKey, _opTime, _prePostImageOpTime); - } -} - } // namespace mongo |
