Skip to content

<fix>[lb]: reject tcp ipvs on old zvr - #4695

Open
ZStack-Robot wants to merge 2 commits into
feature-5.5.28-lb-ipvsfrom
sync/dejing.liu/codex/zstac-86989-cloud-tcp-ipvs-zvr-check
Open

<fix>[lb]: reject tcp ipvs on old zvr#4695
ZStack-Robot wants to merge 2 commits into
feature-5.5.28-lb-ipvsfrom
sync/dejing.liu/codex/zstac-86989-cloud-tcp-ipvs-zvr-check

Conversation

@ZStack-Robot

Copy link
Copy Markdown
Collaborator

Summary

Cloud rejects unsupported TCP IPVS listener requests before persistence and accepts maxConnection during listener creation through the existing system-tag storage model.

Behavior Changes

  • Reject shared-VRouter TCP IPVS creation when the target ZVR version is missing, invalid, or lower than 5.5.38.0; no listener record is persisted on failure.
  • Reject tcpProxyProtocol=v1/v2 for TCP IPVS listeners; disable remains accepted.
  • Accept ordinary maxConnection during listener creation, normalize it to maxConnection::<value>, retain the default when omitted, and reject conflicting field/tag values.

Structural Changes

  • LoadBalancerBackend.validateBeforeCreateListener(...) performs provider-specific validation before LoadBalancerBase persists the listener.
  • The Create API, SDK and API document expose maxConnection; the interceptor normalizes it into the existing system tag without adding a database column or changing the downstream payload format.

Test Coverage

  • TcpIpvsZvrVersionValidationCase covers old-ZVR rejection, supported-ZVR creation, rollback and fixture cleanup.
  • TcpIpvsLoadBalancerListenerApiCase covers create/change maxConnection, refresh payload propagation and field/tag conflict rejection.
  • mvn -pl plugin/loadBalancer -am -DskipTests -DskipJacoco=true compile passed after the history rewrite.
  • Live API validation on 172.25.116.3 covered version/proxy-protocol rejection, input normalization and listener cleanup.

Resolves: ZSTAC-86989, ZSTAC-86990, ZSTAC-87017

sync from gitlab !10655

dejing.liu added 2 commits August 2, 2026 17:36
Fail tcp ipvs listener creation before the listener row is

persisted when the target appliance zvr version is older than

5.5.38. This keeps unsupported routers from receiving an

unusable listener payload and returns a clear API error.

Test: mvn -pl :loadBalancer -am -DskipTests -DskipJacoco=true package

Test: mvn -pl :virtualRouterProvider -am -DskipTests -DskipJacoco=true package

Test: mvn -f test/pom.xml -DskipTests -DskipJacoco=true test-compile

Test: live create tcp ipvs listener on 172.24.194.62

Resolves: ZSTAC-86989

Change-Id: I6e84e4339efa26258a9ce2572d33ab1004795492
Reject tcpProxyProtocol v1 and v2 for TCP IPVS listeners at API
validation time while keeping disable as a no-op.

This keeps HAProxy-only proxy protocol tags out of the IPVS
listener path for both create and change requests.

Test: git diff --check; loadBalancer compile; test-compile
Resolves: ZSTAC-86990
Change-Id: Ife46ca83696fdbfdb5988e45c91f4c485a7f1523
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 7 minutes

Limit details: You’ve used the included review currently available. Your 97 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 56e9cbf2-0c42-480e-8a91-a6a1566ecaea

📥 Commits

Reviewing files that changed from the base of the PR and between 416fc53 and b2d877c.

📒 Files selected for processing (8)
  • plugin/loadBalancer/src/main/java/org/zstack/network/service/lb/LoadBalancerApiInterceptor.java
  • plugin/loadBalancer/src/main/java/org/zstack/network/service/lb/LoadBalancerBackend.java
  • plugin/loadBalancer/src/main/java/org/zstack/network/service/lb/LoadBalancerBase.java
  • plugin/virtualRouterProvider/src/main/java/org/zstack/network/service/virtualrouter/lb/VirtualRouterLoadBalancerBackend.java
  • plugin/virtualRouterProvider/src/main/java/org/zstack/network/service/virtualrouter/vyos/VyosConstants.java
  • test/src/test/groovy/org/zstack/test/integration/networkservice/provider/virtualrouter/loadbalancer/TcpIpvsLoadBalancerListenerApiCase.groovy
  • test/src/test/groovy/org/zstack/test/integration/networkservice/provider/virtualrouter/loadbalancer/TcpIpvsZvrVersionValidationCase.groovy
  • utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Could not fetch remote config from http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml: TimeoutError: The operation was aborted due to timeout
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Comment @coderabbitai help to get the list of available commands.

@MatheMatrix
MatheMatrix force-pushed the sync/dejing.liu/codex/zstac-86989-cloud-tcp-ipvs-zvr-check branch from ae4a65c to b2d877c Compare August 20, 2026 03:57
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.

1 participant