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

Interleaved operations during sharded collection drop violate change stream guarantees

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Execution
    • Sharding EMEA 2021-12-27, Sharding EMEA 2022-01-10

    Description

      Following a conversation with max.hirschhorn, it appears that while dropping a sharded collection, it is possible for CRUD or DDL events to interleave with the collection drops from the individual shards, based on their respective clusterTimes:

        Shard 1 Shard 2 Shard 3
      T1 drop    
      T2   insert  
      T3   drop  
      T4     drop

      In the above scenario, for a single-collection stream, this will cause change streams to break in two significant ways:

      In order for change stream semantics to remain robust through collection drops, there cannot be any CRUD or DDL events on that collection at or later than the clusterTime of the earliest drop event across all shards. Max tells me that this is already the case for sharded renameCollection, and that it may be possible to apply a similar approach to drop. The individual collection drops performed by the dropDatabase command should similarly obey the above constraints.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            bernard.gorman@mongodb.com Bernard Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: