[linstor] Preserve TCP ports during toggle-disk operations#2292
[linstor] Preserve TCP ports during toggle-disk operations#2292kvaps wants to merge 1 commit intocozystack:mainfrom
Conversation
Update fix-duplicate-tcp-ports patch to preserve existing TCP ports when DrbdRscData is recreated during toggle-disk operations. Without this, removeLayerData() frees ports and ensureStackDataExists() may allocate different ones, causing port mismatches between controller and satellites if the satellite misses the update. Also add dh_strip_nondeterminism override in Dockerfile to fix build failures on some JAR files. Upstream: LINBIT/linstor-server#476 (comment) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the piraeus-server Dockerfile to skip dh_strip_nondeterminism for JAR files and expands the fix-duplicate-tcp-ports.diff patch to preserve TCP ports during toggle-disk operations. The patch now includes logic to save existing ports to the layer payload before they are recreated, preventing potential connection failures. A review comment suggests using the Java Stream API to simplify the port conversion loop in the patch for better readability.
| + Set<Integer> portInts = new TreeSet<>(); | ||
| + for (TcpPortNumber port : tcpPorts) | ||
| + { | ||
| + portInts.add(port.value); | ||
| + } | ||
| + payload.drbdRsc.tcpPorts = portInts; |
There was a problem hiding this comment.
This loop to convert the collection of TcpPortNumber to a Set<Integer> can be simplified by using the Java Stream API for a more concise and expressive implementation. This improves readability and maintainability.
payload.drbdRsc.tcpPorts = tcpPorts.stream()
.map(port -> port.value)
.collect(java.util.stream.Collectors.toCollection(TreeSet::new));
What this PR does
Updates the
fix-duplicate-tcp-portspatch to preserve existing TCP ports when DrbdRscData is recreated during toggle-disk operations.Without this fix,
removeLayerData()frees TCP ports from the number pool, andensureStackDataExists()may allocate different ports. If the satellite misses the update (e.g. due to controller restart), it keeps the old ports while peers receive the new ones, causing DRBD connections to fail with StandAlone state.The fix adds
copyDrbdTcpPortsIfExists()which saves existing TCP ports into theLayerPayloadbeforeremoveLayerData()deletes them.Also adds
dh_strip_nondeterminismoverride in Dockerfile to fix build failures on some JAR files.Upstream: LINBIT/linstor-server#476 (comment)
Release note
```release-note
[linstor] Fix TCP port mismatches after toggle-disk operations that could cause DRBD resources to enter StandAlone state
```