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

Set default redundancy policy to zero #501

Merged
merged 2 commits into from
Jul 4, 2019
Merged

Set default redundancy policy to zero #501

merged 2 commits into from
Jul 4, 2019

Conversation

objectiser
Copy link
Contributor

Fixes #497

Signed-off-by: Gary Brown gary@brownuk.com

Signed-off-by: Gary Brown <gary@brownuk.com>
…count

Signed-off-by: Gary Brown <gary@brownuk.com>
@objectiser
Copy link
Contributor Author

@jpkrohling Decided to make it the default regardless of node count - makes it simpler.

@jkandasa Could you test the PR please to make sure fixes the issue.

@objectiser objectiser changed the title Set default redundancy policy to zero when node count is 1 Set default redundancy policy to zero Jul 4, 2019
@jpkrohling
Copy link
Contributor

It would probably be wise to create a ticket to come up with smarter defaults based on the number of nodes, but for now, LGTM.

@jkandasa
Copy link
Member

jkandasa commented Jul 4, 2019

@objectiser can you provide operator image with this PR?

@objectiser
Copy link
Contributor Author

@jkandasa Will do

@codecov
Copy link

codecov bot commented Jul 4, 2019

Codecov Report

Merging #501 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #501      +/-   ##
==========================================
+ Coverage   91.94%   91.95%   +<.01%     
==========================================
  Files          65       65              
  Lines        3290     3292       +2     
==========================================
+ Hits         3025     3027       +2     
  Misses        185      185              
  Partials       80       80
Impacted Files Coverage Δ
pkg/strategy/controller.go 97.72% <100%> (+0.03%) ⬆️

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 01bb012...e5c9667. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jul 4, 2019

Codecov Report

Merging #501 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #501      +/-   ##
==========================================
+ Coverage   91.94%   91.95%   +<.01%     
==========================================
  Files          65       65              
  Lines        3290     3292       +2     
==========================================
+ Hits         3025     3027       +2     
  Misses        185      185              
  Partials       80       80
Impacted Files Coverage Δ
pkg/strategy/controller.go 97.72% <100%> (+0.03%) ⬆️

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 01bb012...e5c9667. Read the comment docs.

@jkandasa
Copy link
Member

jkandasa commented Jul 4, 2019

@objectiser I tested this fix, works as expected,
If we do not pass any redundancyPolicy, jaeger-operator supplies as ZeroRedundancy.
I hope ZeroRedundancy will work with any nodeCount.
I do not see any issue on elasticsearch. It is up and running.

But I see jaeger services are not coming up, maybe another issue?

time="2019-07-04T13:46:54Z" level=error msg="failed to apply the changes" error="CronJob.batch \"simple-prod-es-index-cleaner\" is invalid: spec.jobTemplate.spec.ttlSecondsAfterFinished: Forbidden: disabled by feature-gate" execution="2019-07-04 13:46:54.301508841 +0000 UTC" instance=simple-prod namespace=jkandasa

@objectiser objectiser merged commit a688e34 into jaegertracing:master Jul 4, 2019
@objectiser
Copy link
Contributor Author

@jkandasa Thanks - that other issue is related to #494

@objectiser objectiser deleted the redundancy branch July 4, 2019 14:01
@@ -143,6 +144,9 @@ func normalizeElasticsearch(spec *v1.ElasticsearchSpec) {
if spec.NodeCount == 0 {
spec.NodeCount = 1
}
if spec.RedundancyPolicy == "" {
spec.RedundancyPolicy = esv1.ZeroRedundancy
Copy link
Member

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.

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.

jaeger-operator fails to deploy jaeger services - redunancyPolicy issue
4 participants