Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7932

Solr replication relies on timestamps to sync across machines

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • replication (java)
    • None

    Description

      Spinning off SOLR-7859, noticed there that wall time recorded as commit data on a commit to check if replication needs to be done. In IndexFetcher, there is this code:

            if (!forceReplication && IndexDeletionPolicyWrapper.getCommitTimestamp(commit) == latestVersion) {
              //master and slave are already in sync just return
              LOG.info("Slave in sync with master.");
              successfulInstall = true;
              return true;
            }
      

      It appears as if we are checking wall times across machines to check if we are in sync, this could go wrong.

      Once a decision is made to replicate, we do seem to use generations instead, except for this place below checks both generations and timestamps to see if a full copy is needed..

            // if the generation of master is older than that of the slave , it means they are not compatible to be copied
            // then a new index directory to be created and all the files need to be copied
            boolean isFullCopyNeeded = IndexDeletionPolicyWrapper
                .getCommitTimestamp(commit) >= latestVersion
                || commit.getGeneration() >= latestGeneration || forceReplication;
      

      Attachments

        1. SOLR-7932.patch
          3 kB
          Ramkumar Aiyengar
        2. SOLR-7932.patch
          1 kB
          Ramkumar Aiyengar

        Activity

          People

            Unassigned Unassigned
            andyetitmoves Ramkumar Aiyengar
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: