-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
Sharding 2022-01-10, Sharding 2022-01-24
-
4
Background
The call to getNextSessionOplogBatch by the destination shard should only return oplogs that adhere to the following conditions:
- The oplog entry is part of the collection being migrated
- The oplog entry's shard key value is in the chunk range that is being migrated
The Problem
The SessionCatalogMigrationSource won't filter out the oplog entries that are outside of the migrating chunk range if the oplog has been rewritten to have a OpType of 'n'. Which is what happens as part of session migration.
This causes the performance issue discovered in SERVER-61808, as each consecutive chunk migration will send an increasing number of unnecessary oplogs that the recipient has to handle.
Classes Involved:
- SessionCatalogMigrationSource
- SessionCatalogMigrationDestination
Solution
- Add a test in session_catalog_migration_source_test.cpp to replicate the error where _handleWriteHistory does not ignore oplog entries outside of the appropriate chunk range
- Add a conditional where it currently checks the opType to also check if the opType is kNoop. But make sure to not filter out necessary no-op entries that need to be passed through.
- related to
-
SERVER-61808 The cloning of sessions of the moveChunk gets slower after some migrations
- Closed