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

Improve $changeStream handling of cluster topology changes

    • Query Execution
    • Query 2020-03-23, Query 2020-04-06, Query 2020-04-20

      In SERVER-42723, we introduced an improved mechanism for change streams to detect the addition of a new shard to the cluster. This was motivated by the fact that the existing migrateChunkToNewShard mechanism was not sufficient to account for all potential cases. At present, the migrateChunkToNewShard oplog notification still exists in master for backward-compatibility and upgrade purposes, but we may wish to remove this during the 4.5 development cycle.

      Alternatively, the two approaches could become complementary. At present, we must always open change stream cursors on all shards, and so the approach implemented by SERVER-42723 is always appropriate. However, in the future we may be able to target single-collection or single-DB streams to a subset of shards based on the historical state of the routing table at the moment from which the stream is resuming. In this scenario, the migrateChunkToNewShard approach is appropriate and the new SERVER-42723 mechanism would only be needed in the case of whole-cluster streams, or when a stream is opened on a database which does not yet exist.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            bernard.gorman@mongodb.com Bernard Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: