Subscription: add topic owner epoch fencing#17780
Conversation
|
Findings
( 和 TopicMetaKeeper.java#L112 (https://github.com/apache/iotdb/blob/76f2a882411ba790f7db290740f0232a1e5c4022/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/subscription/meta/topic/TopicMetaKeeper.java#L112)。建议改成版本化或长度前缀格式,或只从
( 和 SubscriptionInfo.java#L340 (https://github.com/apache/iotdb/blob/76f2a882411ba790f7db290740f0232a1e5c4022/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/subscription/SubscriptionInfo.java#L340)。建议在
(https://github.com/apache/iotdb/blob/76f2a882411ba790f7db290740f0232a1e5c4022/iotdb-client/subscription/src/main/java/org/apache/iotdb/session/subscription/consumer/base/AbstractSubscriptionProvider.java#L445)。建议显式处理 |
76f2a88 to
b6086b2
Compare
|
Thanks @Caideyipi, addressed the three findings in b6086b2.
Local verification passed:
The Sonar duplication check is queued again on the new commit; I will follow up if the rerun still fails. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17780 +/- ##
============================================
+ Coverage 40.58% 40.93% +0.34%
- Complexity 2575 2615 +40
============================================
Files 5181 5187 +6
Lines 350404 351646 +1242
Branches 44801 45029 +228
============================================
+ Hits 142225 143948 +1723
+ Misses 208179 207698 -481 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jt2594838
left a comment
There was a problem hiding this comment.
Add an IT to show a complete use case.
| if (!topicMetaKeeper.containsTopicMeta(topicName)) { | ||
| return RpcUtils.SUCCESS_STATUS; | ||
| } | ||
|
|
||
| final TopicMeta topicMeta = topicMetaKeeper.getTopicMeta(topicName); | ||
| if (!topicMeta.isOwnerFencingEnabled()) { | ||
| return RpcUtils.SUCCESS_STATUS; | ||
| } |
There was a problem hiding this comment.
Is it possible to merge contains and get?
There was a problem hiding this comment.
Done. I merged the contains/get path into a single getTopicMeta(...) call and handle the missing-topic case with a null check before owner-fencing validation.
b6086b2 to
25c34c2
Compare
|
Addressed the latest review comments in 25c34c2.
Local verification:
|
|


Summary
Tests