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

Use ES single redundancy by default #531

Merged

Conversation

pavolloffay
Copy link
Member

Related to #501 (comment)

Signed-off-by: Pavol Loffay ploffay@redhat.com

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@@ -133,7 +133,7 @@ func normalizeElasticsearch(spec *v1.ElasticsearchSpec) {
spec.NodeCount = 1
}
if spec.RedundancyPolicy == "" {
spec.RedundancyPolicy = esv1.ZeroRedundancy
spec.RedundancyPolicy = esv1.SingleRedundancy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string option is used to specify replica shards. Instead of exposing an integer ECL decided to expose a human readable string. The number of nodes is taken into the account when calculating the replica shards.

func calculateReplicaShards(policyType esv1.RedundancyPolicyType, dataNodes int) int {
switch policyType {
case esv1.FullRedundancy:
return dataNodes - 1
case esv1.MultipleRedundancy:
return (dataNodes - 1) / 2
case esv1.SingleRedundancy:
return 1
case esv1.ZeroRedundancy:
return 0
default:
return 1
}

This should be defaulting to SingleRedundancy to keep backwards compatibility.

@@ -133,7 +133,7 @@ func normalizeElasticsearch(spec *v1.ElasticsearchSpec) {
spec.NodeCount = 1
}
if spec.RedundancyPolicy == "" {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should be also checking the number of nodes. If it is a single node cluster the redundancy should be zero - https://angristan.xyz/elasticsearch-6-shard-replica-settings-for-single-node-cluster/ otherwise the health of the cluster will be yellow (not green :)).

I will create a separate issue for it.

@codecov
Copy link

codecov bot commented Jul 16, 2019

Codecov Report

Merging #531 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #531   +/-   ##
=======================================
  Coverage   91.97%   91.97%           
=======================================
  Files          69       69           
  Lines        3501     3501           
=======================================
  Hits         3220     3220           
  Misses        196      196           
  Partials       85       85
Impacted Files Coverage Δ
pkg/strategy/controller.go 97.54% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d6bd5f...af994c7. Read the comment docs.

Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Although wouldn't it be easier just to add the node count check aswell and set to zero redundancy as part of this PR? Your call.

@pavolloffay
Copy link
Member Author

I want to test it first.

@pavolloffay pavolloffay merged commit 1ad9482 into jaegertracing:master Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants