You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Ramkumar R. Aiyengar" <an...@gmail.com> on 2015/08/08 21:50:56 UTC

Solr replication making use of timestamps?

Noticed while looking at https://issues.apache.org/jira/browse/SOLR-7859
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;
      }

We are checking wall times across machines to check if we are in sync? That
sounds wrong.. Or I am mistaken here? Why can't we just check generations?
Another 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;

Re: Solr replication making use of timestamps?

Posted by "Ramkumar R. Aiyengar" <an...@gmail.com>.
Crickets..

I have raised https://issues.apache.org/jira/browse/SOLR-7932 anyway for
this issue..

On Sat, Aug 8, 2015 at 8:50 PM, Ramkumar R. Aiyengar <
andyetitmoves@gmail.com> wrote:

> Noticed while looking at https://issues.apache.org/jira/browse/SOLR-7859
> 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;
>       }
>
> We are checking wall times across machines to check if we are in sync?
> That sounds wrong.. Or I am mistaken here? Why can't we just check
> generations? Another 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;
>
>



-- 
Not sent from my iPhone or my Blackberry or anyone else's