Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-915

Allow concurrent registration of slave host controllers

XMLWordPrintable

      Registration of slave host controllers must be done with the exclusive ModelController lock held, in order to ensure that the registering HC sees a consistent config throughout the entire process. The drawback to this is registrations must therefore be done in series, which is inefficient in a large domain.

      We need to evaluate how this can be done in parallel, without losing the correctness semantics. For example, have the first registration request acquire the lock, but then don't release the lock as long as any other registrations are in progress.

      The current lock acquisition mechanism based on an OperationStepHandler acquiring the lock[1] can't do this, or at least not without having the request that acquires the lock have to wait for final completion until all other concurrent requests complete. (Doing that will likely cause problems due to that "unlucky" first slave not getting the expected final response. Plus it just smells bad.)

      A possibility is to remove the currrent lock acquisition in the OSH[1] and instead change the internal HostControllerRegistrationHandler.OperationExecutor API to expose a use-case specific method for the initial registration call.[2] The actual HostControllerRegistrationHandler.OperationExecutor impl is DomainModelControllerService, which is the service that installs the ModelControllerImpl and potentially has closer access to its non-public API (i.e. the locking methods.) So DomainModelControllerService can perhaps therefore coordinate the locking, holding the lock until all active registrations complete.

      [1] https://github.com/wildfly/wildfly-core/blob/master/host-controller/src/main/java/org/jboss/as/host/controller/mgmt/HostControllerRegistrationHandler.java#L283

      [2] I want to change that API anyway. See TODO at https://github.com/wildfly/wildfly-core/blob/master/host-controller/src/main/java/org/jboss/as/host/controller/mgmt/HostControllerRegistrationHandler.java#L155

              kwills@redhat.com Ken Wills
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: