Capped inserts on the primary can have a different natural ordering from secondaries

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 6.0.11
    • Component/s: None
    • Storage Execution
    • ALL
    • Storage Execution 2025-06-09
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Oplog slots can be reserved for inserts prior to taking an exclusive lock on the metadata resource.

      This can generate the following ordering on the primary

      Insert 1 Insert 2
      Reserve oplog slot with TS(1)  
        Reserve oplog slot with TS(2)
        X-lock resource
        Insert document with RID(1)
      X-lock resource  
      Insert document with RID(2)  

      On the secondary, we apply oplog entries serially for non-clustered capped collections. So we would apply oplog entry TS(1) with RID(1) and oplog entry TS(2) with RID(2) as record IDs are not globally unique. This results in a different natural order between the primary and secondaries, which we guarantee for capped collections.

      The same might be possible for updates and deletes.

            Assignee:
            Damian Wasilewicz
            Reporter:
            Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated: