You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "ggbocoder (via GitHub)" <gi...@apache.org> on 2024/08/19 23:59:08 UTC
[PR] Optimize:optimize namingserver [incubator-seata]
ggbocoder opened a new pull request, #6770:
URL: https://github.com/apache/incubator-seata/pull/6770
<!-- Please make sure you have read and understood the contributing guidelines -->
- [ ] I have registered the PR [changes](../changes).
### Ⅰ. Describe what this PR did
### Ⅱ. Does this pull request fix one issue?
<!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
### Ⅲ. Why don't you add test cases (unit test/integration test)?
### Ⅳ. Describe how to verify it
### Ⅴ. Special notes for reviews
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] Optimize:optimize namingserver [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #6770:
URL: https://github.com/apache/incubator-seata/pull/6770#discussion_r1728955064
##########
namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java:
##########
@@ -83,12 +89,22 @@ public class NamingManager {
public NamingManager() {
this.instanceLiveTable = new ConcurrentHashMap<>();
- this.vGroupMap = new ConcurrentHashMap<>();
this.namespaceClusterDataMap = new ConcurrentHashMap<>();
}
@PostConstruct
public void init() {
+ this.vGroupMap = Caffeine.newBuilder()
+ .expireAfterAccess(10000, TimeUnit.MILLISECONDS) // expired time
+ .maximumSize(Integer.MAX_VALUE)
+ .removalListener(new RemovalListener<Object, Object>() {
+
+ @Override
+ public void onRemoval(@Nullable Object key, @Nullable Object value, @NonNull RemovalCause cause) {
+ System.err.println("out " + key + " " + value);
Review Comment:
判断是否启用了debug级别,如果是就输出debug日志,提示用户该vgroup已被删除
Determine whether the debug level is enabled, and if so, print the debug log, prompting the user that the vgroup has been deleted
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: automatic deletion of namingserver vgroup through Caffeine map [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #6770:
URL: https://github.com/apache/incubator-seata/pull/6770
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] Optimize:optimize namingserver [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #6770:
URL: https://github.com/apache/incubator-seata/pull/6770#discussion_r1728937701
##########
namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java:
##########
@@ -83,12 +89,22 @@ public class NamingManager {
public NamingManager() {
this.instanceLiveTable = new ConcurrentHashMap<>();
- this.vGroupMap = new ConcurrentHashMap<>();
this.namespaceClusterDataMap = new ConcurrentHashMap<>();
}
@PostConstruct
public void init() {
+ this.vGroupMap = Caffeine.newBuilder()
+ .expireAfterAccess(10000, TimeUnit.MILLISECONDS) // expired time
Review Comment:
The time should be the heartbeat time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: automatic deletion of namingserver vgroup through Caffeine map [incubator-seata]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #6770:
URL: https://github.com/apache/incubator-seata/pull/6770#issuecomment-2307387063
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/6770?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 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`)](https://app.codecov.io/gh/apache/incubator-seata/commit/5601c36217e3f5dd0a84bd66f61bd7c0d6b5076d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`65152ed`)](https://app.codecov.io/gh/apache/incubator-seata/commit/65152edde63d168f5a4fa9b22d263052ffa11036?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
| [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) | Patch % | Lines |
|---|---|---|
| [...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=) | 60.71% | [6 Missing and 5 partials :warning: ](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) |
| [.../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=) | 76.92% | [3 Missing :warning: ](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) |
| [...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==) | 33.33% | [2 Missing :warning: ](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) |
| [...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=) | 60.00% | [1 Missing and 1 partial :warning: ](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) |
| [.../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% | [1 Missing :warning: ](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) |
| [...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% | [1 Missing :warning: ](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) |
<details><summary>Additional details and impacted files</summary>
[](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)
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org