[octavia-ingress-controller] Fix lost update race conditions in SG add/remove on LB ports #3247
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.44) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 216 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.322
Real PR Conversation Timeline
1 comments
"Review active on #3247"
general
weight: 0.35
dulek
What this PR does / why we need it:
Neutron doesn't let you add or remove just one security group from a port. The
only option is to send the full list of security groups you want the port to
have. So to add one, we read the port's current list, add our SG to it, and
write the whole list back.
The problem is the gap between the read and the write. If anything else changes
the port's security groups in that gap, we don't see it, our write is based on
the old list, so it overwrites (and loses) their change. No error is raised; the
update just silently disappears.
applyNodeSecurityGroupIDForLB) and remove(
disassociateSecurityGroupForLB) paths by:attempt works from fresh state;
revision_numberon the update so Neutron'srevision-if-matchextension rejects the write if the port changed underneath us;
RevisionNumberConstraintFailedconflict viaretry.RetryOnConflict, re-reading each time.updatePortSecurityGroupshelper function.Which issue this PR fixes(if applicable):
Fixes https://github.com/kubernetes/cloud-provider-openstack/issues/2630
Release note:
``
release-note
``NONE
Special notes for reviewers:: This is based on the work done by @stephenfin previously in the PR #2631. This PR aims to add the retry handling, following the pattern @dulek referenced in openshift/cloud-network-config-controller.