Skip to content

Conversation

@jt2594838
Copy link
Contributor

This PR fixes 3 issues:

  1. When removing a region of IoTConsensus, its LogDispatcher will be interrupted. Before the LogDispatcher exits, the thread that handles the removal will wait for at most 30 seconds to release resources. Therefore, when the wait timeouts, both the LogDispatcher thread and the region removal thread may release the same resource. As a result, memory allocated for IoT requests may be freed twice, leading to a negative memory size in the metric.
    Reference count is introduced to avoid memory from being freed twice.

  2. The IoTConsensus may merge several deletions with the same pattern or time range into one. During the process, the merge result will lose its search index.

  3. If a table deletion involves no TsFile, it will not be written to any WAL and cannot be sent by the IoTConsensus.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

Attention: Patch coverage is 51.06383% with 23 lines in your changes missing coverage. Please review.

Project coverage is 39.01%. Comparing base (f1870cb) to head (71c575c).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
...tdb/consensus/iot/logdispatcher/LogDispatcher.java 50.00% 7 Missing ⚠️
.../iotdb/db/storageengine/dataregion/DataRegion.java 0.00% 6 Missing ⚠️
...e/plan/planner/plan/node/write/DeleteDataNode.java 0.00% 4 Missing ⚠️
...nner/plan/node/write/RelationalDeleteDataNode.java 50.00% 2 Missing ⚠️
...s/iot/logdispatcher/IoTConsensusMemoryManager.java 90.90% 1 Missing ⚠️
...planner/plan/node/pipe/PipeEnrichedInsertNode.java 0.00% 1 Missing ⚠️
...lanner/plan/node/write/InsertMultiTabletsNode.java 0.00% 1 Missing ⚠️
...ner/plan/node/write/InsertRowsOfOneDeviceNode.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #16022      +/-   ##
============================================
- Coverage     39.01%   39.01%   -0.01%     
  Complexity      198      198              
============================================
  Files          4848     4848              
  Lines        316085   316076       -9     
  Branches      39807    39816       +9     
============================================
- Hits         123335   123324      -11     
- Misses       192750   192752       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jt2594838 jt2594838 merged commit 52d3455 into master Jul 25, 2025
59 of 60 checks passed
@jt2594838 jt2594838 deleted the fix_negative_iot_queue_size_and_delete_empty_file branch July 25, 2025 03:20
jt2594838 added a commit that referenced this pull request Nov 26, 2025
…sed request when performing empty table deleting (#16022)

* Fix double memory free of iotconsensus queue request during region deletion

* Fix missing searchIndex and lost deletion when no TsFile is involved.
jt2594838 added a commit that referenced this pull request Nov 27, 2025
…6812)

* more accurate mermory size (#15713)

* Fix stuck when stopping a DataNode with large unremovable WAL files (#15727)

* Fix stuck when stopping a DataNode with large unremovable WAL files

* spotless

* add shutdown hook watcher

* Fix logDispatcher stuck

* add re-interrupt

* Add a multiplier to avoid receiver OOM in IoTConsensus (#16102)

* Fix negative iot queue size & missing search index for deletion & missed request when performing empty table deleting (#16022)

* Fix double memory free of iotconsensus queue request during region deletion

* Fix missing searchIndex and lost deletion when no TsFile is involved.

* Fix ref count of IoTConsensus request not decreased in allocation failure (#16169)

* fix IoTConsensus memory management

* Fix ref count of IoTConsensus request not decreased in allocation failure

* fix log level

* remove irrelevant codes from 2.0

* Remove a table test

* Interrupt wal-delete thread when WALManager is closed (#15442)

---------

Co-authored-by: Xiangpeng Hu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants