Skip to content

[ISSUE #14992] Fix v3 client instance distro routing#14993

Open
sbinsun wants to merge 1 commit intoalibaba:developfrom
sbinsun:codex/issue-14992-v3-client-distro
Open

[ISSUE #14992] Fix v3 client instance distro routing#14993
sbinsun wants to merge 1 commit intoalibaba:developfrom
sbinsun:codex/issue-14992-v3-client-distro

Conversation

@sbinsun
Copy link
Copy Markdown

@sbinsun sbinsun commented Apr 28, 2026

Fixes #14992.

What is the purpose of the change

Fix v3 client naming instance register, heartbeat and deregister in cluster mode. Requests to /v3/client/ns/instance now participate in Distro routing like the legacy /v1/ns/instance/beat flow, so instance changes land on the responsible node and can be synchronized to the cluster.

Brief changelog

  • Register DistroFilter for /v3/client/ns/*.
  • Let DistroIpPortTagGenerator read ip, port, and legacy beat from form body when servlet parameters are unavailable.
  • Build RsInfo for v3 heartbeat so missing ephemeral instances can be auto-registered by InstanceOperator#handleBeat.
  • Default v3 client API register/deregister instances to ephemeral unless ephemeral=false is explicitly provided.
  • Add unit tests for v3 distro filter registration, body tag parsing, heartbeat payload, and ephemeral defaults.

Verifying this change

  • mvn -pl naming -am -Dtest=InstanceOpenApiControllerTest,InstanceOperatorClientImplTest,DistroIpPortTagGeneratorTest,NamingConfigTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn -pl naming -am -DskipTests package apache-rat:check checkstyle:check spotbugs:check
  • mvn -B clean compile apache-rat:check checkstyle:check spotbugs:check -DskipTests

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction.
  • Run basic compile, RAT, Checkstyle and SpotBugs checks.
  • Full install and integration-test suites were not run locally.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


xujun102 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link
Copy Markdown

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

@github-actions
Copy link
Copy Markdown

⚠️ Commit Author Verification Failed

The following commits have author emails not linked to any GitHub account.
This will prevent CLA signing and block your PR from being merged.

Commit Author Email
32a587c xujun102 xujun102@midea.com

How to fix:

  1. Add your commit email to your GitHub account: https://github.com/settings/emails
  2. Or update your local git config to use an email already linked to GitHub:
    git config user.name "Your GitHub Username"
    git config user.email "your-github-email@example.com"
    
  3. Amend your commits and force-push:
    git rebase -i HEAD~1 # mark commits as "edit" and amend author
    git push --force-with-lease
    

This check will re-run automatically after you push.

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.

3.2.1 版本的Nacos集群,客户端API注册实例,注销实例问题

2 participants