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'

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.3.0
    • Sharding
    • Fully Compatible
    • Sharding 2022-01-10, Sharding 2022-01-24
    • 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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: