sofastack / sofa-registry

SOFARegistry is a production-level, low-latency, high-availability service registry powered by Ant Financial.
https://www.sofastack.tech/sofa-registry/docs/Home
Apache License 2.0
653 stars 247 forks source link

Release 650 #351

Closed huanglongchao closed 6 months ago

huanglongchao commented 8 months ago

Motivation:

  1. Add API to query the number of links on a session.
  2. Fix the bug where nodes were prohibited.
  3. Add API to query the top sub/pub dataId on a session.
  4. Add a cleanup mechanism for meta data in interface_app.
  5. Add session weight to sessionNode heartbeat information.

Result:

348

350

349

347

Summary by CodeRabbit

codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 86.20690% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 76.73%. Comparing base (3d8297a) to head (98b9016).

:exclamation: Current head 98b9016 differs from pull request most recent head 91e4be5

Please upload reports for the commit 91e4be5 to get more accurate results.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351/graphs/tree.svg?width=650&height=150&src=pr&token=K6x7h4Uxkn&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack)](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack) ```diff @@ Coverage Diff @@ ## master #351 +/- ## ============================================ + Coverage 76.65% 76.73% +0.08% Complexity 48 48 ============================================ Files 495 495 Lines 18506 18591 +85 Branches 1805 1822 +17 ============================================ + Hits 14185 14266 +81 + Misses 3508 3503 -5 - Partials 813 822 +9 ``` | [Files](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack) | Coverage Δ | | |---|---|---| | [...egistry/common/model/constants/ValueConstants.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fcommon%2Fmodel%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fcommon%2Fmodel%2Fconstants%2FValueConstants.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL2NvbW1vbi9tb2RlbC9zcmMvbWFpbi9qYXZhL2NvbS9hbGlwYXkvc29mYS9yZWdpc3RyeS9jb21tb24vbW9kZWwvY29uc3RhbnRzL1ZhbHVlQ29uc3RhbnRzLmphdmE=) | `93.87% <100.00%> (+0.26%)` | :arrow_up: | | [...try/common/model/metaserver/nodes/SessionNode.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fcommon%2Fmodel%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fcommon%2Fmodel%2Fmetaserver%2Fnodes%2FSessionNode.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL2NvbW1vbi9tb2RlbC9zcmMvbWFpbi9qYXZhL2NvbS9hbGlwYXkvc29mYS9yZWdpc3RyeS9jb21tb24vbW9kZWwvbWV0YXNlcnZlci9ub2Rlcy9TZXNzaW9uTm9kZS5qYXZh) | `85.71% <100.00%> (+2.38%)` | :arrow_up: | | [...server/shared/providedata/BaseStopPushService.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fserver%2Fshared%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fserver%2Fshared%2Fprovidedata%2FBaseStopPushService.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL3NlcnZlci9zaGFyZWQvc3JjL21haW4vamF2YS9jb20vYWxpcGF5L3NvZmEvcmVnaXN0cnkvc2VydmVyL3NoYXJlZC9wcm92aWRlZGF0YS9CYXNlU3RvcFB1c2hTZXJ2aWNlLmphdmE=) | `47.22% <100.00%> (ø)` | | | [...c/repository/impl/InterfaceAppsJdbcRepository.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fstore%2Fjdbc%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fjdbc%2Frepository%2Fimpl%2FInterfaceAppsJdbcRepository.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL3N0b3JlL2pkYmMvc3JjL21haW4vamF2YS9jb20vYWxpcGF5L3NvZmEvcmVnaXN0cnkvamRiYy9yZXBvc2l0b3J5L2ltcGwvSW50ZXJmYWNlQXBwc0pkYmNSZXBvc2l0b3J5LmphdmE=) | `87.00% <100.00%> (+3.32%)` | :arrow_up: | | [...eta/lease/session/DefaultSessionServerManager.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fserver%2Fmeta%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fserver%2Fmeta%2Flease%2Fsession%2FDefaultSessionServerManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL3NlcnZlci9tZXRhL3NyYy9tYWluL2phdmEvY29tL2FsaXBheS9zb2ZhL3JlZ2lzdHJ5L3NlcnZlci9tZXRhL2xlYXNlL3Nlc3Npb24vRGVmYXVsdFNlc3Npb25TZXJ2ZXJNYW5hZ2VyLmphdmE=) | `88.88% <50.00%> (-3.12%)` | :arrow_down: | | [...er/session/node/service/MetaServerServiceImpl.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fserver%2Fsession%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fserver%2Fsession%2Fnode%2Fservice%2FMetaServerServiceImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL3NlcnZlci9zZXNzaW9uL3NyYy9tYWluL2phdmEvY29tL2FsaXBheS9zb2ZhL3JlZ2lzdHJ5L3NlcnZlci9zZXNzaW9uL25vZGUvc2VydmljZS9NZXRhU2VydmVyU2VydmljZUltcGwuamF2YQ==) | `86.36% <75.00%> (-2.83%)` | :arrow_down: | | [.../server/shared/meta/AbstractMetaServerService.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fserver%2Fshared%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fserver%2Fshared%2Fmeta%2FAbstractMetaServerService.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL3NlcnZlci9zaGFyZWQvc3JjL21haW4vamF2YS9jb20vYWxpcGF5L3NvZmEvcmVnaXN0cnkvc2VydmVyL3NoYXJlZC9tZXRhL0Fic3RyYWN0TWV0YVNlcnZlclNlcnZpY2UuamF2YQ==) | `85.49% <75.00%> (-0.46%)` | :arrow_down: | | [...server/meta/cleaner/InterfaceAppsIndexCleaner.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fserver%2Fmeta%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fserver%2Fmeta%2Fcleaner%2FInterfaceAppsIndexCleaner.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL3NlcnZlci9tZXRhL3NyYy9tYWluL2phdmEvY29tL2FsaXBheS9zb2ZhL3JlZ2lzdHJ5L3NlcnZlci9tZXRhL2NsZWFuZXIvSW50ZXJmYWNlQXBwc0luZGV4Q2xlYW5lci5qYXZh) | `76.92% <94.44%> (+22.92%)` | :arrow_up: | | [...ta/lease/filter/DefaultForbiddenServerManager.java](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?src=pr&el=tree&filepath=server%2Fserver%2Fmeta%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fserver%2Fmeta%2Flease%2Ffilter%2FDefaultForbiddenServerManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack#diff-c2VydmVyL3NlcnZlci9tZXRhL3NyYy9tYWluL2phdmEvY29tL2FsaXBheS9zb2ZhL3JlZ2lzdHJ5L3NlcnZlci9tZXRhL2xlYXNlL2ZpbHRlci9EZWZhdWx0Rm9yYmlkZGVuU2VydmVyTWFuYWdlci5qYXZh) | `68.11% <50.00%> (-1.73%)` | :arrow_down: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack). Last update [3d8297a...91e4be5](https://app.codecov.io/gh/sofastack/sofa-registry/pull/351?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sofastack).
coderabbitai[bot] commented 8 months ago

Walkthrough

The recent update brings enhancements across various components, focusing on refining server selection algorithms, improving error handling, and introducing new features for better resource management. Notable changes include optimizing server connection strategies, refining server weight handling, and enhancing system resilience and configurability. The version bump signifies meaningful progress in the software's evolution.

Changes

Files Change Summary
.github/workflows/unit-test.yml Added timeout setting and steps for uploading heap dump artifacts; adjusted conditions for existing steps.
VERSION Incremented from 6.4.0 to 6.5.1, indicating new features and improvements.
client/impl/src/main/java/com/alipay/sofa/registry/client/provider/DefaultServerManager.java, client/impl/src/main/java/com/alipay/sofa/registry/client/provider/DefaultServerNode.java, client/impl/src/main/java/com/alipay/sofa/registry/client/remoting/ClientConnection.java, client/impl/src/main/java/com/alipay/sofa/registry/client/remoting/ServerNode.java Enhanced server selection logic, added handling for server weight retrieval and parsing.
client/impl/src/test/java/com/alipay/sofa/registry/client/provider/DefaultServerManagerTest.java Improved test imports and added a new test method for server list retrieval.
server/common/model/src/main/java/com/alipay/sofa/registry/common/model/constants/ValueConstants.java, server/common/model/src/main/java/com/alipay/sofa/registry/common/model/metaserver/nodes/SessionNode.java, server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/bootstrap/config/MetaServerConfig.java, server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/bootstrap/config/MetaServerConfigBean.java, server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/cleaner/InterfaceAppsIndexCleaner.java, server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/lease/filter/DefaultForbiddenServerManager.java, server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/lease/session/DefaultSessionServerManager.java, server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/resource/MetaCenterResource.java, server/server/session/src/main/java/com/alipay/sofa/registry/server/session/node/service/MetaServerServiceImpl.java, server/server/session/src/main/java/com/alipay/sofa/registry/server/session/resource/SessionDigestResource.java, server/server/session/src/main/java/com/alipay/sofa/registry/server/session/resource/SessionOpenResource.java, server/server/shared/src/main/java/com/alipay/sofa/registry/server/shared/meta/AbstractMetaServerService.java, server/server/shared/src/main/java/com/alipay/sofa/registry/server/shared/meta/MetaServerService.java, server/server/shared/src/main/java/com/alipay/sofa/registry/server/shared/providedata/BaseStopPushService.java Introduced new features, methods, and configurations for improved management, cleanup, and functionality.
server/store/api/src/main/java/com/alipay/sofa/registry/store/api/repository/InterfaceAppsRepository.java, server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/mapper/InterfaceAppsIndexMapper.java, server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/repository/impl/InterfaceAppsJdbcRepository.java, server/store/jraft/src/main/java/com/alipay/sofa/registry/jraft/repository/impl/InterfaceAppsRaftRepository.java Added methods for cleaning up deleted entries, enhancing data management.

"In the realm of code, where the bits frolic and play,
A rabbit hopped in, with updates to convey.
🌟 From server weights to cleanup delights,
The changes were made, to reach new heights.
🚀 To version 6.5, we leap and bound,
With every line, improvements found.
So here's to progress, in our digital fest,
Together, we code; together, we're the best!" 🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - 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` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.