[SERVER-62233] Make SessionCatalogMigrationSource handleWriteHistory filter out oplogs outside of the chunkRange with OpType 'n' Created: 22/Dec/21  Updated: 29/Oct/23  Resolved: 14/Jan/22

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Improvement Priority: Major - P3
Reporter: Luis Osta (Inactive) Assignee: Luis Osta (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-61808 The cloning of sessions of the moveCh... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2022-01-10, Sharding 2022-01-24
Participants:
Story Points: 4

 Description   

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

  1. 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
  2. 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.


 Comments   
Comment by Githook User [ 14/Jan/22 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-62233 Filter Rewritten No-Op Oplogs Outside Chunk Range In handleWriteHistory
Branch: master
https://github.com/mongodb/mongo/commit/2b9cd37e1f6c43c79d8ff99f800daea5a3bfb01c

Generated at Thu Feb 08 05:54:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.