Ensure _createHorizonTopologyChangePromiseMapping() uses the correct index in cases of reconfig to remove a node

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Replication
    • Fully Compatible
    • ALL
    • v8.3, v8.0, v7.0
    • Repl 2026-03-30
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      Currently, _createHorizonTopologyChangePromiseMapping() uses the _selfIndex to get the current horizons mapping. This function is called from _errorOnPromisesIfHorizonChanged(). However, in cases of reconfig, at this point we have updated the config but not yet updated our _selfIndex. As a result, we are using a potentially stale _selfIndex, which can lead to a crash.

      Acceptance criteria

      1. Passing the correct self index into _createHorizonTopologyChangePromiseMapping() instead of using _selfIndex
      2. Calling _errorOnPromisesIfHorizonChanged() after _selfIndex has been updated
      3. Refactoring the code to avoid calling _createHorizonTopologyChangePromiseMapping() from _errorOnPromisesIfHorizonChanged(), since it is unclear why we need to construct it within _errorOnPromisesIfHorizonChanged() if we have additional logic later to do a similar job.

      I am leaning towards option 3 since this code is a little confusing to understand.

            Assignee:
            Xuerui Fa
            Reporter:
            Xuerui Fa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: