Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge policy settings are ignored when set in YML #8890

Closed
pickypg opened this issue Dec 11, 2014 · 0 comments · Fixed by #9497
Closed

Merge policy settings are ignored when set in YML #8890

pickypg opened this issue Dec 11, 2014 · 0 comments · Fixed by #9497

Comments

@pickypg
Copy link
Member

pickypg commented Dec 11, 2014

Setting the merge_factor, and other merge policies, from within the YML file are always overridden by the defaults. There is a workaround, which is to set them in a base index template, which will cause them to be taken. This is only an issue in 1.4.0 and 1.4.1.

This came up when trying to set index.merge.policy.merge_factor in elasticsearch.yml to a value other than 10, which is the default. Peaking at the code, the sibling settings are also effected (e.g., index.merge.policy.max_merge_size).

For example, in an elasticsearch.yml:

index.merge.policy.type: log_byte_size 
index.merge.policy.merge_factor: 30 

After creating any index, you will see something along the lines of

[2014-12-10 00:00:00,920][INFO ][cluster.metadata   ] [cluster-name] [index-name-2014.12.10] creating index, cause [auto(bulk api)], shards [4]/[2], mappings [] 
[2014-12-10 00:00:03,664][INFO ][index.merge.policy ] [cluster-name] [index-name-2014.12.10][3] updating merge_factor from [30] to [10]

Notice that it's reverting the merge_factor (and it's not just a mistake in the log output).

All of the providers suffer the from the same issue:

They all get the value set at index-creation time -- defaulting it to the global default if it's unset -- then compare to see if it's different from the global value. If they're different, it uses the index-creation value, which means the global default if it is unset.

The fix is simple, the passed in "default" should just be the global value rather than the global default.

s1monw added a commit to s1monw/elasticsearch that referenced this issue Jan 30, 2015
Due to some unreleased refactorings we lost the persitence of
a perviously set values in MergePolicyProvider. This commit adds this
back and adds a simple unittest.

Closes elastic#8890
@s1monw s1monw removed help wanted adoptme good first issue low hanging fruit labels Jan 30, 2015
@s1monw s1monw self-assigned this Jan 30, 2015
s1monw added a commit that referenced this issue Jan 30, 2015
Due to some unreleased refactorings we lost the persitence of
a perviously set values in MergePolicyProvider. This commit adds this
back and adds a simple unittest.

Closes #8890

Conflicts:
	src/test/java/org/elasticsearch/index/merge/policy/MergePolicySettingsTest.java
s1monw added a commit that referenced this issue Jan 30, 2015
Due to some unreleased refactorings we lost the persitence of
a perviously set values in MergePolicyProvider. This commit adds this
back and adds a simple unittest.

Closes #8890

Conflicts:
	src/test/java/org/elasticsearch/index/merge/policy/MergePolicySettingsTest.java
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Due to some unreleased refactorings we lost the persitence of
a perviously set values in MergePolicyProvider. This commit adds this
back and adds a simple unittest.

Closes elastic#8890

Conflicts:
	src/test/java/org/elasticsearch/index/merge/policy/MergePolicySettingsTest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants