-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 5.0.0, 6.0.0, 7.0.0, 8.0.0-rc0
-
Component/s: None
-
None
-
Catalog and Routing
-
Fully Compatible
-
v8.0
-
CAR Team 2024-06-24
-
200
We identify an inefficiency on the code that perform session cloning during chunk migrations.
In particular SessionCatalogMigrationDestination::_processSessionOplog is called by the recipeint shard of a chunk migration for every oplog entry it receives from the donor through the _getNextSessionMods command.
Then TransactionParticipant::checkStatementExecuted is used to skip the oplog entry if the relative statement has been already executed.
This function is particularly slow because it needs to return the oplog entry associated with the given Statement ID. In order to do so, it traverses the entire history of the transaction and in case of ApplyOps entry it will also extract all the operations using repl::ApplyOps::extractOperationsTo.
Proposal
The SessionCatalogMigrationDestination only needs to know if the Statement got executed but it doesn't need the oplog entry associated with it. Thus, we could simply use TransactionParticipant::checkStatementExecutedNoOplogEntryFetch instead of TransactionParticipant::checkStatementExecuted , and avoid the expensive Transaction history travesal.
- is depended on by
-
SERVER-91160 Increase the throttling of the balancer in slow build variants
- Closed
- related to
-
SERVER-91672 Reduce usage of expensive function TransactionParticipant::checkStatementExecuted
- Closed