-
Notifications
You must be signed in to change notification settings - Fork 38
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
Conversation
Signed-off-by: anisha.kj <[email protected]>
Codecov ReportAttention:
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
☔ View full report in Codecov by Sentry. |
controllers/pravega_segmentstore.go
Outdated
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 | ||
|
There was a problem hiding this comment.
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++
There was a problem hiding this comment.
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.
Signed-off-by: anisha.kj <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 conflictAdded new spec field in CRD as
reservedPortList
and while assigning port to service ensure that it is not in reserved port ListPurpose 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.