Uploaded image for project: 'OpenFlowPlugin'
  1. OpenFlowPlugin
  2. OPNFLWPLUG-854

Change switch mastership before starting services

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Oxygen
    • None
    • clustering
    • None
    • Operating System: All
      Platform: All

      DeviceContextImpl.java class is first starting services before changing mastership on the switch. This could lead to potential race conditions which controllers start sending changes before being master.

      I suggest that DeviceContextImpl.java should first ensure it holds the mastership to the switch and if it works start the services.

      So, the method

      public boolean onContextInstantiateService(final ConnectionContext connectionContext) {

      Should call following line after checking connection is not dead.

      Futures.addCallback(sendRoleChangeToDevice(OfpRole.BECOMEMASTER), new RpcResultFutureCallback());

      For example,

      @Override
      public boolean onContextInstantiateService(final ConnectionContext connectionContext) {

      if (getPrimaryConnectionContext().getConnectionState().equals(ConnectionContext.CONNECTION_STATE.RIP)) {
      LOG.warn("Connection on device {} was interrupted, will stop starting master services.", deviceInfo.getLOGValue());
      return false;
      }

      Futures.addCallback(sendRoleChangeToDevice(OfpRole.BECOMEMASTER), new RpcResultFutureCallback());

            Avishnoi Anil Vishnoi
            castro.jon@gmail.com Jon Castro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: