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.84% +0.25%
- Complexity 2575 2616 +41
============================================
Files 5181 5204 +23
Lines 350404 354127 +3723
Branches 44801 45303 +502
============================================
+ Hits 142225 144635 +2410
- Misses 208179 209492 +1313 ☔ View full report in Codecov by Harness. 🚀 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.
b6086b2 to
25c34c2
Compare
|
Addressed the latest review comments in 25c34c2.
Local verification:
|
|
jt2594838
left a comment
There was a problem hiding this comment.
Have you waited for all leases to expire before transferring the ownership?
| /** | ||
| * Alters a topic with the specified properties. | ||
| * | ||
| * @param topicName If the topic name contains single quotes, the passed parameter needs to be | ||
| * enclosed in backticks. | ||
| * @param properties A {@link Properties} object containing the topic properties to alter. | ||
| * @throws IoTDBConnectionException If a connection issue occurs. | ||
| * @throws StatementExecutionException If the SQL statement execution fails. | ||
| */ | ||
| void alterTopic(final String topicName, final Properties properties) | ||
| throws IoTDBConnectionException, StatementExecutionException; |
There was a problem hiding this comment.
Is the TopicOwner allowed to be modified by this interface?
Or can it only be modified through alterTopicOwner?
| public TopicMeta buildAlteredTopicMeta(TAlterTopicReq req) { | ||
| final TopicMeta existedTopicMeta = subscriptionInfo.deepCopyTopicMeta(req.getTopicName()); | ||
| return existedTopicMeta == null | ||
| ? null | ||
| : existedTopicMeta.deepCopyWithUpdatedAttributes(req.getTopicAttributes()); | ||
| } |
| return new TSStatus(TSStatusCode.ALTER_TOPIC_ERROR.getStatusCode()) | ||
| .setMessage( | ||
| String.format( | ||
| "Failed to alter topic %s, the topic is not existed", req.getTopicName())); | ||
| } |
| } else { | ||
| throw new SemanticException( | ||
| "Not support for this sql in ALTER TOPIC, please enter topicName."); | ||
| } |


Summary
Tests