ReplicaSetAwareServiceRegistry calls services in the wrong order if there are dependencies

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The ReplicaSetAwareRegistry is a collection of services we call for stepup/stepdown/etc. Today we can specify dependencies for the services so that they become initialized in a specific order.

      The way we do this is by first doing a topological sort for the graph of dependencies and then registering them one after the other in that order into the internal vector of services.

      The problem is that we then run a forward iteration on the vector whenever we have to call onStepUp/onStepDown/etc. This is fine for construction-like semantics such as stepup or when there's consistent data available since we'll call them in the order of dependencies. However, when doing destruction-like operations such as stepdown/rollback we use the same order which would mean we first destroy the parent before reaching the child.

      Ideally we should do those operations in reverse order of insertion whenever we need to do those latter operations in order to ensure the dependencies are respected.

      Today there are no users of this feature and we try to enforce no dependencies in our services but we were exploring doing so for the sharding initialization in mongod as part of SERVER-112934.

            Assignee:
            Unassigned
            Reporter:
            Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: