Default merge policy

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Default merge policy

root23
Hi all,
I am little bit confused.
We are on solr 6.  and as per the documentation i think solr 6 uses
TieredMergePolicyFactory.
However we have not specified it in the following way
<mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
  <int name="maxMergeAtOnce">10</int>
  <int name="segmentsPerTier">10</int>
</mergePolicyFactory>

We still use <mergeFactor>25</mergeFactor>. which i understand is not used
by TieredMergePolicyFactory.

So my confusion is that which MergePolicy is being used by solr  ? and what
settings are being applied.






--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Default merge policy

Erick Erickson
bq. However we have not specified it in the following way

Is that a typo and you mean "have now specified"?

There's code in SolrIndexConfig:

if (policy instanceof TieredMergePolicy) {
  if (mergeFactor != -1) {
    tieredMergePolicy.setMaxMergeAtOnce(mergeFactor);
    tieredMergePolicy.setSegmentsPerTier(mergeFactor);
  }
}

So TieredMergePolicy is the default and sets these two parameters to
your mergeFactor. This support is removed in Solr 7, so I'd recommend
you update your configs.

Best,
Erick
On Fri, Oct 12, 2018 at 8:53 AM root23 <[hidden email]> wrote:

>
> Hi all,
> I am little bit confused.
> We are on solr 6.  and as per the documentation i think solr 6 uses
> TieredMergePolicyFactory.
> However we have not specified it in the following way
> <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
>   <int name="maxMergeAtOnce">10</int>
>   <int name="segmentsPerTier">10</int>
> </mergePolicyFactory>
>
> We still use <mergeFactor>25</mergeFactor>. which i understand is not used
> by TieredMergePolicyFactory.
>
> So my confusion is that which MergePolicy is being used by solr  ? and what
> settings are being applied.
>
>
>
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Default merge policy

Shawn Heisey-2
In reply to this post by root23
On 10/12/2018 8:32 AM, root23 wrote:

> We are on solr 6.  and as per the documentation i think solr 6 uses
> TieredMergePolicyFactory.
> However we have not specified it in the following way
> <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
>    <int name="maxMergeAtOnce">10</int>
>    <int name="segmentsPerTier">10</int>
> </mergePolicyFactory>
>
> We still use <mergeFactor>25</mergeFactor>. which i understand is not used
> by TieredMergePolicyFactory.

Supplementing what Erick said.  Erick's info is completely valid.

For the version you are on, specifying a mergeFactor of 25 with no other
merge-policy related config effectively results in this config:

<mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
   <int name="maxMergeAtOnce">25</int>
   <int name="segmentsPerTier">25</int>
   <int name="maxMergeAtOnceExplicit">30</int>
</mergePolicyFactory>

I would recommend replacing mergeFactor with an explicit merge policy
config.  Since you are going with numbers higher than default, you
should set maxMergeAtOnceExplicit to three times the value of the other
two settings.  In this case, that would be 75.

Thanks,
Shawn