Skip to content

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

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

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

Conversation

@zstack-robot-2

Copy link
Copy Markdown
Collaborator

Summary

Cloud rejects unsupported TCP IPVS listener requests before persistence, including old ZVR appliances and HAProxy-only Proxy Protocol settings.

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.

Structural Changes

  • LoadBalancerBackend.validateBeforeCreateListener(...) performs provider-specific validation before LoadBalancerBase persists the listener.
  • virtualRouterProvider resolves the target appliance and checks VirtualRouterMetadataVO.zvrVersion.
  • The listener interceptor rejects enabled Proxy Protocol only for TCP IPVS, without changing HAProxy behavior.

Test Coverage

  • TcpIpvsZvrVersionValidationCase covers old-ZVR rejection, supported-ZVR creation, rollback and fixture cleanup.
  • TcpIpvsLoadBalancerListenerApiCase covers TCP IPVS Proxy Protocol rejection and the accepted disable value.
  • Live API validation on 172.25.116.3 confirmed version/proxy-protocol failures leave no listener residue.

Resolves: ZSTAC-86989, ZSTAC-86990

sync from gitlab !10764

dejing.liu added 3 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 HAProxy-only connectionIdleTimeout, nbprocess, and enabled
proxy protocol settings for TCP IPVS listeners.

Do not generate HAProxy defaults for new TCP IPVS listeners, and
validate generic system tag create or update operations so they cannot
bypass the listener API checks. Keep HAProxy listener behavior intact.

Test: loadBalancer compile and Groovy test-compile
Resolves: ZSTAC-86990
Change-Id: Ife46ca83696fdbfdb5988e45c91f4c485a7f1523
Allow TCP IPVS listener creation when the target appliance has not
reported a valid ZVR version. Reject only known versions below the
minimum, and trim stored version text before comparison.

Cover unknown, whitespace-padded old, and supported versions.

Test: virtualRouterProvider package and Groovy test-compile
Resolves: ZSTAC-86989
Change-Id: I8f1ae9f04be9669e17efbd15ec634bb86a37e912
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 55 minutes.

View limit details

Limit details: You’ve used the included review currently available. Your 61 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).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b853ba01-4fd0-4ba3-81c3-8c24748ecf45

📥 Commits

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

📒 Files selected for processing (9)
  • 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/loadBalancer/src/main/java/org/zstack/network/service/lb/LoadBalancerManagerImpl.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 timed out.
⚙️ 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.

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