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

Shard merge importing collection without timestamp can trigger invariant failure in HistoricalCatalogIdTracker.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Serverless
    • Fully Compatible
    • ALL
    • Server Serverless 2023-07-10, Server Serverless 2023-07-24, Server Serverless 2023-08-07, Server Serverless 2023-08-21
    • 105

      Shard merge does non-timestamped catalog writes when importing collections (i,e, collections created during physical cloning phase). But, does timestamped catalog writes when dropping those collections. This mixed timestamp mode usage can trigger invariant failure in HistoricalCatalogIdTracker which was introduced to support point-in-time catalog lookups PM-2218.

       

      Noting the problematic sequence here.

      1. Fixture starts migrationId1.
      2. Recipient imports the donor collection  say <tenanId1>_db.coll untimestamped.
        a) <catalogRecordID<X>,  boost::none TS> entry gets inserted into HistoricalCatalogIdTracker for this nss.
      3. migrationid1 get committed.
      4. Fixture drops the collection <tenanId1>_db.coll but it’s timestamped writes with dropTS as TS(100).
        a) <boost::none,  TS(100)> entry gets inserted into HistoricalCatalogIdTracker for this nss.
      5. Fixture starts another migrationId2.
      6. Recipient imports the donor collection  say <tenanId1>_db.coll untimestamped.
        a) This will skip inserting entry into HistoricalCatalogIdTracker as HistoricalCatalogId list is non-empty for this nss.
      7. When the oldest ts  is no longer < TS(100), TimestampMonitor deletes the expired 2-a) and 4-a) entries from HistoricalCatalogIdTracker.
      8. migrationid2 get committed.
      9. Fixture drops the collection <tenanId1>_db.coll but it’s timestamped writes.
        a) This throws the invariant failure because HistoricalCatalogId list is empty for this nss.

       

            Assignee:
            suganthi.mani@mongodb.com Suganthi Mani
            Reporter:
            suganthi.mani@mongodb.com Suganthi Mani
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: