diff options
author | Blake Oler <blake.oler@mongodb.com> | 2018-07-06 13:03:07 -0400 |
---|---|---|
committer | Blake Oler <blake.oler@mongodb.com> | 2018-07-06 13:03:32 -0400 |
commit | 8f884cdf9e5aa437eed791c00fb7b66ce41d38e3 (patch) | |
tree | 7572650533752c4617223f1a3d6b32cd8442e87e /src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp | |
parent | fa908b824495cc3c963387899091be2b5b38c2c5 (diff) | |
download | mongo-8f884cdf9e5aa437eed791c00fb7b66ce41d38e3.tar.gz |
Revert "SERVER-31031 Skip oplog entries that are unrelated to the chunk being migrated"
This reverts commit c305d79efaffeeda60079b0f4b4207841c3c0c77.
Diffstat (limited to 'src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp')
-rw-r--r-- | src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp index b23777a35d0..43144f59b99 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp @@ -748,16 +748,13 @@ void MigrationChunkClonerSourceLegacy::_xfer(OperationContext* opCtx, repl::OpTime MigrationChunkClonerSourceLegacy::nextSessionMigrationBatch( OperationContext* opCtx, BSONArrayBuilder* arrBuilder) { + repl::OpTime opTimeToWait; + auto seenOpTimeTerm = repl::OpTime::kUninitializedTerm; + if (!_sessionCatalogSource) { return {}; } - repl::OpTime opTimeToWait; - auto seenOpTimeTerm = repl::OpTime::kUninitializedTerm; - auto css = CollectionShardingState::get(opCtx, _args.getNss()); - auto metadata = css->getMetadata(opCtx); - const ChunkRange range(_args.getMinKey(), _args.getMaxKey()); - while (_sessionCatalogSource->hasMoreOplog()) { auto result = _sessionCatalogSource->getLastFetchedOplog(); @@ -777,14 +774,6 @@ repl::OpTime MigrationChunkClonerSourceLegacy::nextSessionMigrationBatch( seenOpTimeTerm == newOpTime.getTerm()); } - // Skip appending CRUD operations that don't pertain to the ChunkRange being migrated. - if (result.oplog->isCrudOpType()) { - auto docKey = metadata.extractDocumentKey(result.oplog->getOperationToApply()); - if (!range.containsKey(docKey)) { - continue; - } - } - auto oplogDoc = result.oplog->toBSON(); // Use the builder size instead of accumulating the document sizes directly so that we |