ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Query Execution
    • QE 2026-11-23
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Fixes SERVER-138544.

      When a bulkWrite sent through mongos has two or more nsInfo entries with the same ns but different collectionUUID values, WriteBatchExecutor::buildBulkWriteRequest merged them into one entry (keyed by namespace alone), keeping only the first entry's UUID and checking it for every op targeting that namespace. A write with a stale UUID could silently succeed against a recreated collection, and a write with a correct or absent UUID could be rejected with CollectionUUIDMismatch (361).

      The dedup key is now (namespace, collectionUUID), so each op is validated on the shard against the UUID of the entry it actually references — matching replica set behavior. Entries that share both namespace and UUID are still merged, so there is no wire-size change for the common case.

      Scope is UWE only; the legacy BulkWriteOp::buildBulkCommandRequest path is unchanged.

      Tests: new unit test WriteBatchExecutorTest.ExecuteSimpleWriteBatchRepeatedNssDifferentUUIDs in write_batch_executor_test.cpp (plus assertBulkWriteRequest now compares collectionUUID), and new jstest jstests/sharding/bulk_write_repeated_ns_collection_uuid.js covering the three ticket scenarios end to end.

            Assignee:
            Mickey Winters
            Reporter:
            Mickey Winters
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: