You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "SteveYurongSu (via GitHub)" <gi...@apache.org> on 2025/03/10 05:42:57 UTC
[PR] [To dev/1.3][DRAFT] optimize [iotdb]
SteveYurongSu opened a new pull request, #15048:
URL: https://github.com/apache/iotdb/pull/15048
## Description
### Content1 ...
### Content2 ...
### Content3 ...
<!--
In each section, please describe design decisions made, including:
- Choice of algorithms
- Behavioral aspects. What configuration values are acceptable? How are corner cases and error
conditions handled, such as when there are insufficient resources?
- Class organization and design (how the logic is split between classes, inheritance, composition,
design patterns)
- Method organization and design (how the logic is split between methods, parameters and return types)
- Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics)
-->
<!-- It's good to describe an alternative design (or mention an alternative name) for every design
(or naming) decision point and compare the alternatives with the designs that you've implemented
(or the names you've chosen) to highlight the advantages of the chosen designs and names. -->
<!-- If there was a discussion of the design of the feature implemented in this PR elsewhere
(e. g. a "Proposal" issue, any other issue, or a thread in the development mailing list),
link to that discussion from this PR description and explain what have changed in your final design
compared to your original proposal or the consensus version in the end of the discussion.
If something hasn't changed since the original discussion, you can omit a detailed discussion of
those aspects of the design here, perhaps apart from brief mentioning for the sake of readability
of this PR description. -->
<!-- Some of the aspects mentioned above may be omitted for simple and small changes. -->
<hr>
This PR has:
- [ ] been self-reviewed.
- [ ] concurrent read
- [ ] concurrent write
- [ ] concurrent read and write
- [ ] added documentation for new or modified features or behaviors.
- [ ] added Javadocs for most classes and all non-trivial methods.
- [ ] added or updated version, __license__, or notice information
- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious
for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold
for code coverage.
- [ ] added integration tests.
- [ ] been tested in a test IoTDB cluster.
<!-- Check the items by putting "x" in the brackets for the done things. Not all of these items
apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items
from the checklist above are strictly necessary, but it would be very helpful if you at least
self-review the PR. -->
<hr>
##### Key changed/added classes (or packages if there are too many classes) in this PR
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [To dev/1.3] Pipe: Optimize realtime performace when pipe starts after long time stop with heavy data backlog [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #15048:
URL: https://github.com/apache/iotdb/pull/15048#issuecomment-2709634739
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=15048) **Quality Gate passed**
Issues
 [9 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=15048&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=15048&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=15048&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=15048&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=15048&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=15048)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [To dev/1.3][DRAFT] optimize [iotdb]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #15048:
URL: https://github.com/apache/iotdb/pull/15048#issuecomment-2709564001
## [Codecov](https://app.codecov.io/gh/apache/iotdb/pull/15048?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 `41.52542%` with `69 lines` in your changes missing coverage. Please review.
> Project coverage is 41.42%. Comparing base [(`d469c58`)](https://app.codecov.io/gh/apache/iotdb/commit/d469c584bd1177e90792ef6c4e21bf4b5f76e8f7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`3d02c86`)](https://app.codecov.io/gh/apache/iotdb/commit/3d02c86003947250bb7cc44d1f4d3ba71daa6f5a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 4 commits behind head on dev/1.3.
| [Files with missing lines](https://app.codecov.io/gh/apache/iotdb/pull/15048?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...otdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java](https://app.codecov.io/gh/apache/iotdb/pull/15048?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Fagent%2Ftask%2FPipeDataNodeTaskAgent.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9hZ2VudC90YXNrL1BpcGVEYXRhTm9kZVRhc2tBZ2VudC5qYXZh) | 0.00% | [31 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/15048?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...k/connector/PipeRealtimePriorityBlockingQueue.java](https://app.codecov.io/gh/apache/iotdb/pull/15048?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Fagent%2Ftask%2Fsubtask%2Fconnector%2FPipeRealtimePriorityBlockingQueue.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9hZ2VudC90YXNrL3N1YnRhc2svY29ubmVjdG9yL1BpcGVSZWFsdGltZVByaW9yaXR5QmxvY2tpbmdRdWV1ZS5qYXZh) | 0.00% | [21 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/15048?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...g/apache/iotdb/commons/pipe/config/PipeConfig.java](https://app.codecov.io/gh/apache/iotdb/pull/15048?src=pr&el=tree&filepath=iotdb-core%2Fnode-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fcommons%2Fpipe%2Fconfig%2FPipeConfig.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9ub2RlLWNvbW1vbnMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2lvdGRiL2NvbW1vbnMvcGlwZS9jb25maWcvUGlwZUNvbmZpZy5qYXZh) | 18.18% | [9 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/15048?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ol/thrift/async/IoTDBDataRegionAsyncConnector.java](https://app.codecov.io/gh/apache/iotdb/pull/15048?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Fconnector%2Fprotocol%2Fthrift%2Fasync%2FIoTDBDataRegionAsyncConnector.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9jb25uZWN0b3IvcHJvdG9jb2wvdGhyaWZ0L2FzeW5jL0lvVERCRGF0YVJlZ2lvbkFzeW5jQ29ubmVjdG9yLmphdmE=) | 20.00% | [8 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/15048?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>
```diff
@@ Coverage Diff @@
## dev/1.3 #15048 +/- ##
===========================================
Coverage 41.42% 41.42%
Complexity 193 193
===========================================
Files 3545 3545
Lines 228004 228160 +156
Branches 27261 27288 +27
===========================================
+ Hits 94448 94520 +72
- Misses 133556 133640 +84
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/iotdb/pull/15048?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary>🚀 New features to boost your workflow: </summary>
- ❄ [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [To dev/1.3][DRAFT] optimize [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #15048:
URL: https://github.com/apache/iotdb/pull/15048#issuecomment-2709506423
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=15048) **Quality Gate passed**
Issues
 [9 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=15048&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=15048&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=15048&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=15048&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=15048&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=15048)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [To dev/1.3] Pipe: Optimize realtime performace when pipe starts after long time stop with heavy data backlog [iotdb]
Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu merged PR #15048:
URL: https://github.com/apache/iotdb/pull/15048
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [To dev/1.3] Pipe: Optimize realtime performace when pipe starts after long time stop with heavy data backlog [iotdb]
Posted by "Caideyipi (via GitHub)" <gi...@apache.org>.
Caideyipi commented on code in PR #15048:
URL: https://github.com/apache/iotdb/pull/15048#discussion_r1986995573
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/thrift/async/IoTDBDataRegionAsyncConnector.java:
##########
@@ -453,6 +464,11 @@ private void transferQueuedEventsIfNecessary() throws Exception {
LOGGER.debug("Polled event {} from retry queue.", polledEvent);
}
}
+
+ // Stop retrying if the execution time exceeds the threshold for better realtime performance
+ if (System.currentTimeMillis() - retryStartTime > maxRetryExecutionTimeMsPerCall) {
+ break;
+ }
}
// Trigger cron heartbeat event in retry connector to send batch in time
Review Comment:
Consider triggering this even if the retryEventQueue is empty?
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java:
##########
@@ -111,6 +111,54 @@ protected Map<Integer, PipeTask> buildPipeTasks(final PipeMeta pipeMetaFromConfi
return new PipeDataNodeBuilder(pipeMetaFromConfigNode).build();
}
+ ////////////////////////// Manage by Pipe Name //////////////////////////
+
+ @Override
+ protected void startPipe(final String pipeName, final long creationTime) {
+ final PipeMeta existedPipeMeta = pipeMetaKeeper.getPipeMeta(pipeName);
+ final PipeStatus status = existedPipeMeta.getRuntimeMeta().getStatus().get();
+ if (PipeStatus.STOPPED.equals(status) || status == null) {
+ restartPipeToReloadResourceIfNeeded(existedPipeMeta);
+ }
+
+ super.startPipe(pipeName, creationTime);
+ }
+
+ private void restartPipeToReloadResourceIfNeeded(final PipeMeta pipeMeta) {
+ if (System.currentTimeMillis() - pipeMeta.getStaticMeta().getCreationTime()
+ < PipeConfig.getInstance().getPipeStuckRestartMinIntervalMs()) {
+ return;
+ }
+
+ final AtomicLong lastRestartTime =
+ PIPE_NAME_TO_LAST_RESTART_TIME_MAP.get(pipeMeta.getStaticMeta().getPipeName());
+ if (lastRestartTime != null
+ && System.currentTimeMillis() - lastRestartTime.get()
+ < PipeConfig.getInstance().getPipeStuckRestartMinIntervalMs()) {
+ LOGGER.info(
+ "Skipping reload resource for stopped pipe {} before starting it because reloading resource is too frequent.",
+ pipeMeta.getStaticMeta().getPipeName());
+ return;
+ }
+
+ if (PIPE_NAME_TO_LAST_RESTART_TIME_MAP.isEmpty()) {
+ LOGGER.info(
+ "Flushing storage engine before restarting pipe {}.",
+ pipeMeta.getStaticMeta().getPipeName());
+ final long currentTime = System.currentTimeMillis();
+ StorageEngine.getInstance().syncCloseAllProcessor();
+ WALManager.getInstance().syncDeleteOutdatedFilesInWALNodes();
Review Comment:
Seemingly this is for dynamic flushing? Will this cause more small tsFiles?(i.e. flush here, and when collecting historical tsFiles)
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/dataregion/realtime/PipeRealtimeDataRegionHybridExtractor.java:
##########
@@ -223,6 +226,10 @@ private boolean canNotUseTabletAnyMore(final PipeRealtimeEvent event) {
}
private boolean isPipeTaskCurrentlyRestarted(final PipeRealtimeEvent event) {
+ if (!isPipeEpochKeepTsFileAfterStuckRestartEnabled) {
+ return false;
+ }
+
final boolean isPipeTaskCurrentlyRestarted =
PipeDataNodeAgent.task().isPipeTaskCurrentlyRestarted(pipeName);
if (isPipeTaskCurrentlyRestarted && event.mayExtractorUseTablets(this)) {
Review Comment:
May better reduce the logger to "per epoch"
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [To dev/1.3] Pipe: Optimize realtime performace when pipe starts after long time stop with heavy data backlog [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #15048:
URL: https://github.com/apache/iotdb/pull/15048#issuecomment-2709848058
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=15048) **Quality Gate passed**
Issues
 [9 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=15048&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=15048&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=15048&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=15048&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=15048&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=15048)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [To dev/1.3] Pipe: Optimize realtime performace when pipe starts after long time stop with heavy data backlog [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #15048:
URL: https://github.com/apache/iotdb/pull/15048#issuecomment-2710256429
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=15048) **Quality Gate passed**
Issues
 [9 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=15048&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=15048&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=15048&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=15048&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=15048&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=15048)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org