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

Write path: checking whether a document belongs to a shard is only required for unversioned (or ignored versioned) write commands

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 6.0.0, 7.0.0, 8.0.0-rc0
    • Component/s: None
    • Labels:
    • Catalog and Routing
    • CAR Team 2024-04-29, CAR Team 2024-05-13
    • 2

      The goal of PM-2423 was to stop generating change stream events for write operations that modified orphan documents. These write operations that potentially modify orphan documents could be categorized in two different groups:

      1.  The common case: write operations targeting more than one shard (i.e. write cmds attaching the ShardVersion::IGNORED()).
      2.  Direct write operations against a shard.

      For the first case, we decided to change our implementation to avoid writing on orphan documents at all. Thus, we won't generate a change stream event because the write doesn't happen at all. For the second case, after some discussion we agreed on always performing the write but marking it as fromMigrate: true if the document is not owned (ref).  

      Although targeted write operations (i.e. attacking only one shard, which implies that they are properly shard versioned) were not affected by the problem described above, after some discussions we decided to also perform the ownership check on each document. AFAIK we could totally skip that. If I recall correctly, all the write paths rely on the PreWriteFilter so it shouldn't be difficult to change a bit its logic.

       

            Assignee:
            sergi.mateo-bellido@mongodb.com Sergi Mateo Bellido
            Reporter:
            sergi.mateo-bellido@mongodb.com Sergi Mateo Bellido
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: