You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mark Miller (JIRA)" <ji...@apache.org> on 2015/09/14 22:00:46 UTC

[jira] [Commented] (SOLR-7932) Solr replication relies on timestamps to sync across machines

    [ https://issues.apache.org/jira/browse/SOLR-7932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14744143#comment-14744143 ] 

Mark Miller commented on SOLR-7932:
-----------------------------------

I think when in SolrCloud mode perhaps it's just best to always replicate and count on peer sync as the short circuit. If replication is really not needed, most of the work will be skipped properly via filenames and checksums anyway, rather than this sloppy way that may miss a replication in rare cases.

> Solr replication relies on timestamps to sync across machines
> -------------------------------------------------------------
>
>                 Key: SOLR-7932
>                 URL: https://issues.apache.org/jira/browse/SOLR-7932
>             Project: Solr
>          Issue Type: Bug
>          Components: replication (java)
>            Reporter: Ramkumar Aiyengar
>         Attachments: SOLR-7932.patch, SOLR-7932.patch
>
>
> 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:
> {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;
>       }
> {code}
> 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..
> {code}
>       // 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;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org