Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-62233

Make SessionCatalogMigrationSource handleWriteHistory filter out oplogs outside of the chunkRange with OpType 'n'

    • 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

      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.

            Assignee:
            luis.osta@mongodb.com Luis Osta (Inactive)
            Reporter:
            luis.osta@mongodb.com Luis Osta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: