Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-2014

Synchronization is stopped if remote server was not restored during refresh interval

Attach filesAttach ScreenshotWatch issueCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0-M16
    • 2.0.0-M18
    • ldap
    • None

    Description

      Steps to reproduce:
      1. Set up synchronization between two servers S1 and S2
      2. Stop server S2
      3. Wait more than refresh interval
      4. Start server S2

      Observed result:
      S1 never read/update data from S2

      Reason:
      When connection lost and we tried to reconnect at least one time, ReplicationConsumerImpl.disconnected field become equals to true.

      ReplicationConsumerImpl:

          private ReplicationStatusEnum doRefreshOnly()
          {
              while ( !disconnected )
              {
                  CONSUMER_LOG.debug( "==================== Refresh Only ==========" );
      
                  try
                  {
                      doSyncSearch( SynchronizationModeEnum.REFRESH_ONLY, reload );
      
                      CONSUMER_LOG.debug( "--------------------- Sleep for {} seconds ------------------", ( config.getRefreshInterval() / 1000 ) );
                      Thread.sleep( config.getRefreshInterval() );
                      CONSUMER_LOG.debug( "--------------------- syncing again ------------------" );
      
                  }
                  catch ( InterruptedException ie )
                  {
                      CONSUMER_LOG.warn( "refresher thread interrupted" );
      
                      return ReplicationStatusEnum.DISCONNECTED;
                  }
                  catch ( Exception e )
                  {
                      CONSUMER_LOG.error( "Failed to sync with refresh only mode", e );
                      return ReplicationStatusEnum.DISCONNECTED;
                  }
              }
      
              return ReplicationStatusEnum.STOPPED;
          }
      

      After Thread.sleep( config.getRefreshInterval() ); we exit while loop, and method return ReplicationStatusEnum.STOPPED instead of DISCONNECTED.

      LdapServer:

          public void startReplicationConsumers() throws Exception
          {
      ...............
                                          do
                                          {
                                              status = consumer.startSync();
                                          }
                                          while ( status == ReplicationStatusEnum.REFRESH_REQUIRED );
      
                                          if ( status == ReplicationStatusEnum.STOPPED )
                                          {
                                              // Exit the loop
                                              break;
                                          }
      ...............
      

      In that we exit from thread, and our server never try to get updated data from S2..

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            akiran Kiran Ayyagari
            alexander.kozlov.iv Alexander Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment