apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.25k stars 8.77k forks source link

optimize: automatic deletion of namingserver vgroup through Caffeine map #6770

Closed ggbocoder closed 1 month ago

ggbocoder commented 1 month ago

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 60.78431% with 20 lines in your changes missing coverage. Please review.

Project coverage is 52.27%. Comparing base (5601c36) to head (65152ed). Report is 1 commits behind head on 2.x.

Files Patch % Lines
...ache/seata/namingserver/manager/NamingManager.java 60.71% 6 Missing and 5 partials :warning:
.../src/main/java/org/apache/seata/server/Server.java 76.92% 3 Missing :warning:
...common/metadata/namingserver/NamingServerNode.java 33.33% 2 Missing :warning:
...ache/seata/namingserver/entity/bo/NamespaceBO.java 60.00% 1 Missing and 1 partial :warning:
.../namingserver/NamingserverRegistryServiceImpl.java 0.00% 1 Missing :warning:
...ver/storage/db/store/VGroupMappingDataBaseDAO.java 0.00% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/6770/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## 2.x #6770 +/- ## ============================================ + Coverage 52.15% 52.27% +0.11% - Complexity 6289 6302 +13 ============================================ Files 1064 1064 Lines 37194 37215 +21 Branches 4414 4417 +3 ============================================ + Hits 19399 19454 +55 + Misses 15882 15837 -45 - Partials 1913 1924 +11 ``` | [Files](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [.../namingserver/NamingserverRegistryServiceImpl.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?src=pr&el=tree&filepath=discovery%2Fseata-discovery-namingserver%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fdiscovery%2Fregistry%2Fnamingserver%2FNamingserverRegistryServiceImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGlzY292ZXJ5L3NlYXRhLWRpc2NvdmVyeS1uYW1pbmdzZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlYXRhL2Rpc2NvdmVyeS9yZWdpc3RyeS9uYW1pbmdzZXJ2ZXIvTmFtaW5nc2VydmVyUmVnaXN0cnlTZXJ2aWNlSW1wbC5qYXZh) | `0.00% <0.00%> (ø)` | | | [...ver/storage/db/store/VGroupMappingDataBaseDAO.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fstorage%2Fdb%2Fstore%2FVGroupMappingDataBaseDAO.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvc3RvcmFnZS9kYi9zdG9yZS9WR3JvdXBNYXBwaW5nRGF0YUJhc2VEQU8uamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...common/metadata/namingserver/NamingServerNode.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?src=pr&el=tree&filepath=common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcommon%2Fmetadata%2Fnamingserver%2FNamingServerNode.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9jb21tb24vbWV0YWRhdGEvbmFtaW5nc2VydmVyL05hbWluZ1NlcnZlck5vZGUuamF2YQ==) | `36.66% <33.33%> (-0.38%)` | :arrow_down: | | [...ache/seata/namingserver/entity/bo/NamespaceBO.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?src=pr&el=tree&filepath=namingserver%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fnamingserver%2Fentity%2Fbo%2FNamespaceBO.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bmFtaW5nc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9uYW1pbmdzZXJ2ZXIvZW50aXR5L2JvL05hbWVzcGFjZUJPLmphdmE=) | `73.68% <60.00%> (-4.89%)` | :arrow_down: | | [.../src/main/java/org/apache/seata/server/Server.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2FServer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvU2VydmVyLmphdmE=) | `49.18% <76.92%> (+2.88%)` | :arrow_up: | | [...ache/seata/namingserver/manager/NamingManager.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?src=pr&el=tree&filepath=namingserver%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fnamingserver%2Fmanager%2FNamingManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bmFtaW5nc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9uYW1pbmdzZXJ2ZXIvbWFuYWdlci9OYW1pbmdNYW5hZ2VyLmphdmE=) | `65.88% <60.71%> (-1.12%)` | :arrow_down: | ... and [7 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/6770/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)