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

Change Streams - provide details for metadata operations instead of (or in addition to) invalidation

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.1
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • Fully Compatible
    • Query 2018-07-02, Query 2018-07-16
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When watching a database or entire cluster, provide notification of metadata events like collection drops and renames rather than invalidating the stream. In case of watching a single collection, use the same format to provide details about invalidation (whether it was caused by collection drop, db drop, collection rename, etc).

      Original Description:

      Change streams report the namespace for operations such as inserts, updates and deletes. The namespace information would be useful in case of the invalidate event.

      Here is an example where the namespace would be extremely helpful:

      mdbsrv-01
      db1.coll1
      db1.coll2
      db1.coll3

      Application thread-1 opens a change stream on db1.coll1 and thread-2 opens a change stream on db1.coll3. Everything captured from these collections will be send to mdbsrv-02, db2.do_it_now.

      If db1.coll1 gets dropped, the invalidate event is triggered and a invalidate document is inserted into mdbsrv-02, db2.do_it_now. The invalidate document only contains the _id and operationType: "invalidate".

      By looking into db2.do_it_now, how do I know which collection has inserted the invalidate document into the collection?

            Assignee:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Reporter:
            rodrigo@logwriter.net Rodrigo Nascimento
            Votes:
            1 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: