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

Issue 674: Fix for segment store services are not coming up properly #675

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

anishakj
Copy link
Contributor

@anishakj anishakj commented Nov 7, 2023

Change log description

While deploying pravega with 12 segmentstore pods, segmentstore service was using one of the ports used by other service containerd and was causing conflict
Added new spec field in CRD as reservedPortList and while assigning port to service ensure that it is not in reserved port List

Purpose of the change

Fixes #674

What the code does

Assigning port to segment store services which is not in the reserved portList, if it finds conflict next port will be assigned.

How to verify it

Verified pravega installation with 12 segmentstore pods and ensured that ports mentioned in reservedportlist are getting skipped.

@anishakj anishakj marked this pull request as ready for review November 7, 2023 14:57
@anishakj anishakj requested a review from jkhalack November 7, 2023 14:57
@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (7f7f64a) 82.27% compared to head (f51da35) 82.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #675      +/-   ##
==========================================
- Coverage   82.27%   82.11%   -0.17%     
==========================================
  Files          17       17              
  Lines        4136     4149      +13     
==========================================
+ Hits         3403     3407       +4     
- Misses        586      593       +7     
- Partials      147      149       +2     
Files Coverage Δ
api/v1beta1/pravegacluster_types.go 90.23% <ø> (ø)
controllers/pravega_segmentstore.go 97.94% <60.00%> (-0.81%) ⬇️
pkg/util/pravegacluster.go 95.26% <0.00%> (-2.58%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 647 to 657
for util.ContainsElement(p.Spec.ReservedPortList, int32(serviceport)+i+servicePortIncrement) {
servicePortIncrement++
}

service.Spec.Ports[0].Port = int32(serviceport) + i + servicePortIncrement

for util.ContainsElement(p.Spec.ReservedPortList, int32(adminPort)+i+adminPortIncrement) {
adminPortIncrement++
}
service.Spec.Ports[1].Port = int32(adminPort) + i + adminPortIncrement

Copy link

Choose a reason for hiding this comment

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

I'm not sure why we have all this math here.
We could have a currentServicePort initialized to int32(serviceport) and a currentAdminPort initialized to int32(adminPort).
At the end of every iteration of SS replicas we run currentServicePort++ and currentAdminPort++.
If currentServicePort value is on reserved list, we run currentServicePort++.
Again, if currentAdminPort value is on reserved list, we run currentAdminPort++

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @jkhalack for the feedback, have made changes as suggested.

Copy link

@jkhalack jkhalack left a comment

Choose a reason for hiding this comment

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

LGTM

@anishakj anishakj requested a review from krishan-Rai November 8, 2023 10:18
Copy link

@krishan-Rai krishan-Rai left a comment

Choose a reason for hiding this comment

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

LGTM

@anishakj anishakj merged commit 0db1b6a into master Nov 14, 2023
1 of 2 checks passed
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.

Segment store services are not coming up properly
4 participants