You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Renaud Delbru <re...@sindicetech.com> on 2015/03/23 17:20:47 UTC

Behavior of JettySolrRunner#start wrt Solr data/tlog directories

Dear all,

I am currently working on the SOLR-6273 (CDCR) and I am currently facing 
an issue with the Solr test framework. I am trying to write a unit test 
where the slave node is stopped then restarted during the execution of 
the unit test, in order to verify the replication of tlog files 
(something that is introduced by CDCR). The scenario is the following:
- instantiate a master and slave node
- send a first batch of updates to the master
- stop the slave
- send a second batch of updates to the mater
- restart the slave in order to trigger replication
- verify that the update logs between the master and slaves are properly 
replicated.

The problem I am facing is that whenever I restart the slave, using the 
SolrJettyRunner.start() method, the Solr data directory and tlog 
subdirectory are cleaned up, and not reused. Therefore I am unable to 
test the scenario where the slave has some partial tlog files.

Is there a way to tell the jetty server to reuse the Solr data directory 
/ tlog directory instead of erasing it ? Or is there another way to 
emulate that a slave node is down ?

Thanks
-- 
Renaud Delbru

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


Re: Behavior of JettySolrRunner#start wrt Solr data/tlog directories

Posted by Renaud Delbru <re...@sindicetech.com>.
Hi Alan,

Thanks for your feedback,
Indeed after your reply, I have investigated a bit more, and discovered 
that this was the UpdateHandler's init that was clearing the tlog 
directory if a non persistent directory is used. The solution is to 
switch to a persistent directory factory for my tests.
-- 
Renaud Delbru

On 03/23/2015 04:32 PM, Alan Woodward wrote:
> Hi Renaud,
>
> I don't think there's anything special in JettySolrRunner that cleans up
> old directories, and the various Replication tests do something very
> similar to what you want here - are you sure it's the JSR code that's
> removing files here?
>
> Alan Woodward
> www.flax.co.uk <http://www.flax.co.uk>
>
>
> On 23 Mar 2015, at 16:20, Renaud Delbru wrote:
>
>> Dear all,
>>
>> I am currently working on the SOLR-6273 (CDCR) and I am currently
>> facing an issue with the Solr test framework. I am trying to write a
>> unit test where the slave node is stopped then restarted during the
>> execution of the unit test, in order to verify the replication of tlog
>> files (something that is introduced by CDCR). The scenario is the
>> following:
>> - instantiate a master and slave node
>> - send a first batch of updates to the master
>> - stop the slave
>> - send a second batch of updates to the mater
>> - restart the slave in order to trigger replication
>> - verify that the update logs between the master and slaves are
>> properly replicated.
>>
>> The problem I am facing is that whenever I restart the slave, using
>> the SolrJettyRunner.start() method, the Solr data directory and tlog
>> subdirectory are cleaned up, and not reused. Therefore I am unable to
>> test the scenario where the slave has some partial tlog files.
>>
>> Is there a way to tell the jetty server to reuse the Solr data
>> directory / tlog directory instead of erasing it ? Or is there another
>> way to emulate that a slave node is down ?
>>
>> Thanks
>> --
>> Renaud Delbru
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> <ma...@lucene.apache.org>
>> For additional commands, e-mail: dev-help@lucene.apache.org
>> <ma...@lucene.apache.org>
>>
>

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


Re: Behavior of JettySolrRunner#start wrt Solr data/tlog directories

Posted by Alan Woodward <al...@flax.co.uk>.
Hi Renaud,

I don't think there's anything special in JettySolrRunner that cleans up old directories, and the various Replication tests do something very similar to what you want here - are you sure it's the JSR code that's removing files here?

Alan Woodward
www.flax.co.uk


On 23 Mar 2015, at 16:20, Renaud Delbru wrote:

> Dear all,
> 
> I am currently working on the SOLR-6273 (CDCR) and I am currently facing an issue with the Solr test framework. I am trying to write a unit test where the slave node is stopped then restarted during the execution of the unit test, in order to verify the replication of tlog files (something that is introduced by CDCR). The scenario is the following:
> - instantiate a master and slave node
> - send a first batch of updates to the master
> - stop the slave
> - send a second batch of updates to the mater
> - restart the slave in order to trigger replication
> - verify that the update logs between the master and slaves are properly replicated.
> 
> The problem I am facing is that whenever I restart the slave, using the SolrJettyRunner.start() method, the Solr data directory and tlog subdirectory are cleaned up, and not reused. Therefore I am unable to test the scenario where the slave has some partial tlog files.
> 
> Is there a way to tell the jetty server to reuse the Solr data directory / tlog directory instead of erasing it ? Or is there another way to emulate that a slave node is down ?
> 
> Thanks
> -- 
> Renaud Delbru
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>