lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fermin Silva <ferm...@olx.com>
Subject Re: Block until replication finishes
Date Fri, 28 Mar 2014 13:43:24 GMT
Hi,

that's what I'm trying. I'm however really cautious when it comes to a
    while (somethingIsTrue) { doSomething; sleep; }

Is that safe? What if the slave hungs up, the network is slow/fails, etc?

Thanks


On Thu, Mar 27, 2014 at 1:40 PM, Chris W <chris1980.sql@gmail.com> wrote:

> Hi
>
>  You can use the "details" command to check the status of replication.
> http://localhost:8983/solr/core_name/replication?command=details
>
> The command returns an xml output and look out for the "isReplicating"
> field in the output. Keep running the command in a loop until the flag
> becomes false. Thats when you know its done. I would also recommend you to
> check the # of docs in the output at source/destination after the
> replication to be sure
>
>
> HTH
>
>
>
>
> On Thu, Mar 27, 2014 at 6:35 AM, Fermin Silva <fermins@olx.com> wrote:
>
> > Hi,
> >
> > we are moving to native replication with SOLR 3.5.1.
> > Because we want to control the replication from another program (a cron
> > job), we decided to curl the slave to issue a fetchIndex command.
> >
> > The problem we have is that the curl returns immediately, while the
> > replication still goes in the background.
> > We need to know when the replication is done, and then resume the cron
> job.
> >
> > Is there a way to block on the replication call until it's done similar
> to
> > waitForSearcher=true when committing ?
> > If not, what other possibilities we have?
> >
> > Just in case, here is the solrconfig part in the slave (we pass masterUrl
> > in the curl url)
> >
> > <requestHandler name="/replication" class="solr.ReplicationHandler">
> >     <lst name="slave">
> >       <str name="masterUrl"></str>
> >     </lst>
> >   </requestHandler>
> >
> >
> > Many thanks in advance
> >
> > --
> > Fermin Silva
> >
>
>
>
> --
> Best
> --
> C
>



-- 
Fermin Silva
Speed & Scalability Team

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message