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

Add ability for operations to be annotated with something that can be seen and filtered in change stream

    • Query Execution

      More and more users and internal applications are utilizing change streams to replicate changes to/from other systems. For these systems, providing an easy way to not read your own writes would alleviate this currently difficult challenge.

      Device Sync and Triggers make a lot of writes to MongoDB and also listen to all events in MongoDB. For Device Sync it is important that we filter out all writes that WE made. We do this by keeping track of all of the SessionIds that we use to make changes to MongoDB within a transaction and filter them out there (because they are in the change event)

      This is cumbersome and a performance hit (keeping track of these sessions and persisting them).

      In an ideal world, we could have some form of $comment that adds an annotation to an oplog entry that can be filtered out with a change stream match expression.

      This could also be helpful for the triggers product, cluster-to-cluster replication, etc in an attempt to not read your own writes (or at least easily know that they are yours) and prevent infinitely recursive triggers (trigger that updates the collection it is listening to suddenly spiraling out of control)

      Thread about this: https://mongodb.slack.com/archives/C6WSFCJDC/p1680026502600029

            Assignee:
            Unassigned Unassigned
            Reporter:
            tyler.kaye@mongodb.com Tyler Kaye
            Votes:
            0 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: