Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-7101

Add support for honouring MongoDB read preference in change stream after promotion pt 2

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • 2.5-backlog
    • 2.5.0.Alpha1
    • mongodb-connector
    • None

      Since https://issues.redhat.com/browse/DBZ-5953 was never actually implemented but still deemed necessary, per discussions with jcechace@redhat.com offline I am reopening under a new ticket since the automation insists it be closed . Please see comments on that Jira for additional context and colour.

      Prototype of this functionality may be found here:
      https://github.com/debezium/debezium/pull/4315

      When change streams are in a getMore loop against an open cursor, they do not respect the read preference defined in the connection if there is a promotion event that invalidates the primary / secondary status of the server it is streaming from. This feature is to leverage SDAM and monitor the server's status, and if the read preference is invalidated, close the cursor noting the resume token, re-open against a read preference compatible node, and resume streaming from the resume token. This feature is key in order to keep load off the primary node.

      This is 1 of 2 lingering items remaining from adding support to read from MongoDB secondaries. Specifically, from #4071

      What is missing:

      • When secondary which is being used to stream changes is promoted to primary the event stream is not recreated

            jcechace@redhat.com Jakub Čecháček
            btiernay Bob Tiernay (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: