You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by sivaram <yo...@gmail.com> on 2010/11/03 15:46:21 UTC

Corename after Swap in MultiCore

Hi everyone,

Long question but please hold on. I'm using a multicore Solr instance to
index different documents from different sources( around 4) and I'm using a
common config for all the cores. So, for each source I have core and temp
core like 'doc' and 'doc-temp'. So, everytime I want to get new data, I do
dataimport to the temp core and then swap the cores. For swaping I'm using
the postCommit event listener to make sure the swap is done after the
completing commit. 

After the first swap when I use solr.core.name on the doc-temp it is
returning doc as its name ( because the commit is done on the doc's data dir
after the first swap ). How do I get the core name of the doc-temp here in
order to swap again with .swap ? 

I'm stuck here. Please help me. Also if anyone know for sure if a dataimport
is being done on a core then the next swap query will be executed only after
this dataimport is finished?

Thanks in advance.
Ram.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Corename-after-Swap-in-MultiCore-tp1835325p1835325.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: Corename after Swap in MultiCore

Posted by sivaram <yo...@gmail.com>.

Do you mean solr.core.name has the wrong value after the swap? You
swapped doc-temp so now it's doc and solr.core.name is still doc-temp?
This completely contradicts my experience, what version of solr are you
using?
Why use postCommit? You're running the risk of performing a swap when
you don't mean to.  Are you using DIH? If so, I'd go with querying the
status of the import until it's done and then performing the swap.


Hi Ephraim,

No, the solr.core.name is not doc-temp. It is doc after the first swap. I'm
expecting it to be doc-temp but after the swap the data dir is getting
changed so it is giving me doc ( I always do full import on doc-temp, so i
expect the solr.core.name as doc-temp ). Which is not the case i'm looking
for. I'm using Solr 1.4.1.

Right now I temporarily came up with writing a class to handle the risk of
performing a swap when i don't mean to. But eventually I'm looking for
getting the core name after every full import( if I do import on doc-temp I
should be able to retrieve the doc-temp core name programatically ). 

Yes I use DIH for some cores. If I check the status and it is not complete,
I should wait for the next query time to make sure it is done. So, I don't
want to wait for that time. I want to swap immediately after it is done. 

Thanks again and please let me know if any of my approaches sound wrong. 

Ram.



-- 
View this message in context: http://lucene.472066.n3.nabble.com/Corename-after-Swap-in-MultiCore-tp1835325p1889634.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Corename after Swap in MultiCore

Posted by Shawn Heisey <so...@elyograg.org>.
On 11/12/2010 3:00 PM, Shawn Heisey wrote:
>  I have not tried reloading the core instead of restarting Solr, I
>  should do that.

Just so everyone's aware: Reloading the core is not enough to get 
solr.core.name to be updated in the healthcheck filename.  Solr must be 
restarted.



Re: Corename after Swap in MultiCore

Posted by Shawn Heisey <el...@elyograg.org>.
On 11/12/2010 2:48 PM, sivaram wrote:
> That is good if we can restart the solr. But we don't want to restart the
> whole solr after every commit because some of the core usually have to
> update for comparatively short times. So, we do a core reload to get all the
> synonyms and other stuff getting updated with out the solr reload.

Understandable.  The way I've set up my Solr architecture, full rebuilds 
are rare, so we do not swap cores unless we have to reindex for some 
reason, normally only because of  a schema change.  I have not tried 
reloading the core instead of restarting Solr, I should do that.

Only one shard sees frequent additions, every two minutes.  The others 
see inserts only once a day.  All of them have deletes happening every 
ten minutes.

Shawn


Re: Corename after Swap in MultiCore

Posted by sivaram <yo...@gmail.com>.
>> Shawn

That is good if we can restart the solr. But we don't want to restart the
whole solr after every commit because some of the core usually have to
update for comparatively short times. So, we do a core reload to get all the
synonyms and other stuff getting updated with out the solr reload.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Corename-after-Swap-in-MultiCore-tp1835325p1891671.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Corename after Swap in MultiCore

Posted by Shawn Heisey <so...@elyograg.org>.
On 11/7/2010 9:11 AM, Ephraim Ofir wrote:
> Do you mean solr.core.name has the wrong value after the swap? You
> swapped doc-temp so now it's doc and solr.core.name is still doc-temp?
> This completely contradicts my experience, what version of solr are you
> using?
> Why use postCommit? You're running the risk of performing a swap when
> you don't mean to.  Are you using DIH? If so, I'd go with querying the
> status of the import until it's done and then performing the swap.

I have seen something like this in 1.4.1.  I use this:

<admin>
<defaultQuery>*:*</defaultQuery>
<healthcheck type="file">${solr.core.name}-enabled</healthcheck>
</admin>

After a core swap between live and build, the filename that controls new 
new live core is still called "build-enabled" which is confusing.  Since 
I have a master/slave setup and a load balancer, I always restart Solr 
after I do a swap, just to keep it straight.

Shawn


RE: Corename after Swap in MultiCore

Posted by Ephraim Ofir <Ep...@icq.com>.
Do you mean solr.core.name has the wrong value after the swap? You
swapped doc-temp so now it's doc and solr.core.name is still doc-temp?
This completely contradicts my experience, what version of solr are you
using?
Why use postCommit? You're running the risk of performing a swap when
you don't mean to.  Are you using DIH? If so, I'd go with querying the
status of the import until it's done and then performing the swap.

Ephraim Ofir


-----Original Message-----
From: sivaram [mailto:yogendra.boppana@gmail.com] 
Sent: Wednesday, November 03, 2010 4:46 PM
To: solr-user@lucene.apache.org
Subject: Corename after Swap in MultiCore


Hi everyone,

Long question but please hold on. I'm using a multicore Solr instance to
index different documents from different sources( around 4) and I'm
using a
common config for all the cores. So, for each source I have core and
temp
core like 'doc' and 'doc-temp'. So, everytime I want to get new data, I
do
dataimport to the temp core and then swap the cores. For swaping I'm
using
the postCommit event listener to make sure the swap is done after the
completing commit. 

After the first swap when I use solr.core.name on the doc-temp it is
returning doc as its name ( because the commit is done on the doc's data
dir
after the first swap ). How do I get the core name of the doc-temp here
in
order to swap again with .swap ? 

I'm stuck here. Please help me. Also if anyone know for sure if a
dataimport
is being done on a core then the next swap query will be executed only
after
this dataimport is finished?

Thanks in advance.
Ram.
-- 
View this message in context:
http://lucene.472066.n3.nabble.com/Corename-after-Swap-in-MultiCore-tp18
35325p1835325.html
Sent from the Solr - User mailing list archive at Nabble.com.