Repository navigation
Conversation
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17666 +/- ##
============================================
+ Coverage 45.91% 45.93% +0.02%
Complexity 712 712
============================================
Files 5502 5502
Lines 398764 398872 +108
Branches 51963 52002 +39
============================================
+ Hits 183090 183232 +142
+ Misses 215674 215640 -34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaExecutionVisitor.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaRegionStateMachine.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/IoTDBDataRegionAsyncSink.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/sync/IoTDBDataRegionSyncSink.java
|
|
Preserve pipe metric registrations across metric service restarts while removing operator state on deregistration. Keep master synchronization and prevent late events from recreating dropped pipe metrics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR fixes several potential memory/resource leaks in Pipe runtime lifecycle cleanup.
Previously, some passive paths could create or retain per-schema-region or per-pipe runtime state during leader notification, snapshot handling, queue cleanup, metric updates, pipe drop, and schema-region deletion. This could leave stale listeners, metrics, committers, rate limiters, aggregate runtime state, or floating memory counters after a pipe/schema region was closed, dropped, altered, or deleted.
Main changes:
Avoid creating schema-region pipe listeners from passive paths.
schemaListenerIfPresent(...)and use it in snapshot/load/write/delete and queue cleanup paths.SchemaRegionListeningQueueand its metrics.Cleanup stale per-pipe runtime state on pipe drop/discard.
PipeEventCommitManagercommitter and restart-time state when a pipe is dropped.Make floating memory accounting safe for late event releases.
pipeName_creationTimeinstead of relying only on livePipeMeta.Fix aggregate processor shared-state cleanup.
Tests
Added unit tests for:
PipeSchemaRegionListenerManagerTest: verifies leader state does not create listeners and unused closed listeners are cleaned up.PipeTaskAgentTest: verifies floating memory usage remains tracked after pipe drop until late release, and zero counters are cleaned after drop.This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
PipeSchemaRegionListenerManagerPipeDataNodeRuntimeAgentSchemaExecutionVisitorSchemaRegionStateMachineDataNodeRegionManagerPipeDataNodeTaskAgentPipeEventCommitManagerIoTDBSinkPipeDataNodeSinglePipeMetricsPipeTsFileToTabletsMetricsPipeTaskAgentAggregateProcessor