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 Shalin Shekhar Mangar <sh...@gmail.com> on 2009/06/06 08:06:38 UTC

Re: Refresh synonyms.txt file via replication

On Sat, May 30, 2009 at 6:45 AM, mlathe <ml...@gmail.com> wrote:

>
> I would like to provide an admin interface (in a different system) that
> would update the synonyms.txt file and automatically inform a set of Solr
> instances that are being replicated to update their synonyms.txt file too.
>
> This discussion shows a possible solution:
>
> http://www.nabble.com/Refresh-of-synonyms.txt-without-reload-td19629361.html
> Namely use the CoreAdmin system to do a RELOAD, rather than forcing tomcat
> to reload the webapp.
>
> Here is my setup:
> 1) I made these instances (both are separate webapps running one core named
> "core", this allows me to use the CoreAdmin):
> http://localhost:8080/solr_rep_master/core/admin/
> http://localhost:8080/solr_rep_slave1/core/admin/
> 2) the master's config looks like this:
>    <lst name="master">
>        <str name="replicateAfter">startup</str>
>        <str name="replicateAfter">commit</str>
>        <str name="snapshot">startup</str>
>        <str name="snapshot">commit</str>
>        <str name="confFiles">schema.xml,stopwords.txt,synonyms.txt</str>
>    </lst>
> 3) the slave's config looks like this:
>    <lst name="slave">
>        <str
> name="masterUrl">http://localhost:8080/solr_rep_master/core/replication
> </str>
>        <str name="pollInterval">00:00:20</str>
>        <str name="compression">internal</str>
>    </lst>
>
> First Question:
> If i update the "solr_rep_master"'s conf/synonyms.txt file and GET
> http://localhost:8080/solr_rep_master/admin/cores?action=RELOAD&core=core,
> the config is not replicated to the slave. Isn't a "RELOAD" considered a
> startup in regards to the master's replicateAfter setting?
>

Yes, it is. Let me run a few tests to see if I can reproduce this.


> Second Question:
> If i force an empty commit, like this:
> curl
> http://localhost:8080/solr_rep_master/core/update?stream.body=%3Ccommit/%3E
> Then the changed synonym.txt config file are replicated to the slave.
> Unfortunately now I need to do a core "RELOAD" on both the master and slave
> to get them to see the updated synonym.txt file.
>

Calling RELOAD on slave should not be necessary. If a configuration file is
replicated, the slave is always reloaded. Can you try using the analysis.txt
on a field which has the SynonymFilterFactory enabled to see if the new file
is indeed not getting used?

-- 
Regards,
Shalin Shekhar Mangar.

Re: Refresh synonyms.txt file via replication

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
Hi ,
Unfortunately , the problem is that an 'empty' commit does not really
do anything. I mean, it is not a real commit.Solr takes a look to find
if the index is changed and if not, the call is ignored

When we designed it, the choice was to look for all the changed conf
files also to decide if a replication is required or not . That proved
to be expensive and error prone. so we relied on index change to
trigger this.


take the case of schema.xml change . schema.xml is changed first and
then indexing is done . If the schema.xml is replicated and slave core
is reloaded , it will cause error.

you can raise an issue and we can find out a better way to do this.

--Noble




On Wed, Jun 10, 2009 at 3:23 AM, mlathe<ml...@gmail.com> wrote:
>
>
> Shalin Shekhar Mangar wrote:
>>
>>> Second Question:
>>> If i force an empty commit, like this:
>>> curl
>>> http://localhost:8080/solr_rep_master/core/update?stream.body=%3Ccommit/%3E
>>> Then the changed synonym.txt config file are replicated to the slave.
>>> Unfortunately now I need to do a core "RELOAD" on both the master and
>>> slave
>>> to get them to see the updated synonym.txt file.
>>>
>> Calling RELOAD on slave should not be necessary. If a configuration file
>> is
>> replicated, the slave is always reloaded. Can you try using the
>> analysis.txt
>> on a field which has the SynonymFilterFactory enabled to see if the new
>> file
>> is indeed not getting used?
>>
>
> I'm a bit confused now. It's not doing what i saw before.
> Now I can't get it to replicate when i do an "empty" commit. Rather I need
> to do a real data update, and a commit, then any changes to the
> solr_rep_master's conf/synonyms.txt file get replicated to the slave, and
> the slave seems to pick up the change without reloading.
>
> I'm not really sure what you mean by the analysis.txt file. Do you mean the
> /analysis request handler? I've been making synonyms for "solr" so it is
> pretty obvious if it was picked up.
>
> Can you explain what you expect should happen? ie
> 1) should the slave replicate when you do an empty commit on the master?
> 2) If you change a master config file, and it is replicated to the slave,
> would you expect the slave to pick it up automatically, but the master will
> require a reload?
>
> Thanks
> --Matthias
> --
> View this message in context: http://www.nabble.com/Refresh-synonyms.txt-file-via-replication-tp23789187p23951978.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: Refresh synonyms.txt file via replication

Posted by mlathe <ml...@gmail.com>.

Shalin Shekhar Mangar wrote:
> 
>> Second Question:
>> If i force an empty commit, like this:
>> curl
>> http://localhost:8080/solr_rep_master/core/update?stream.body=%3Ccommit/%3E
>> Then the changed synonym.txt config file are replicated to the slave.
>> Unfortunately now I need to do a core "RELOAD" on both the master and
>> slave
>> to get them to see the updated synonym.txt file.
>>
> Calling RELOAD on slave should not be necessary. If a configuration file
> is
> replicated, the slave is always reloaded. Can you try using the
> analysis.txt
> on a field which has the SynonymFilterFactory enabled to see if the new
> file
> is indeed not getting used?
> 

I'm a bit confused now. It's not doing what i saw before.
Now I can't get it to replicate when i do an "empty" commit. Rather I need
to do a real data update, and a commit, then any changes to the
solr_rep_master's conf/synonyms.txt file get replicated to the slave, and
the slave seems to pick up the change without reloading.

I'm not really sure what you mean by the analysis.txt file. Do you mean the
/analysis request handler? I've been making synonyms for "solr" so it is
pretty obvious if it was picked up.

Can you explain what you expect should happen? ie
1) should the slave replicate when you do an empty commit on the master?
2) If you change a master config file, and it is replicated to the slave,
would you expect the slave to pick it up automatically, but the master will
require a reload?

Thanks
--Matthias
-- 
View this message in context: http://www.nabble.com/Refresh-synonyms.txt-file-via-replication-tp23789187p23951978.html
Sent from the Solr - User mailing list archive at Nabble.com.