Pengzna opened a new pull request, #19321: URL: https://github.com/apache/iotdb/pull/19321
## Description Dropping a DataRegion under IoTConsensusV2 calls `DeletionResourceManager.getInstance()` during DAL cleanup. If the region has never used a deletion resource manager, cleanup creates a manager, allocates a buffer, opens a DAL file, and starts a persistence thread just to close them immediately. Closing an idle persistence thread interrupts its blocking queue wait and logs the interruption at WARN unconditionally. For example, with IoTConsensusV2 configured: ```sql CREATE DATABASE root.dal_warn; INSERT INTO root.dal_warn.d(time, s) VALUES (1, 1); DROP DATABASE root.dal_warn; ``` Before this change, region cleanup can initialize DAL resources and emit `Interrupted when waiting for taking DeletionResource from blocking queue to serialize.` even though no SQL DELETE was issued and cleanup succeeds. After this change, cleanup closes only an existing manager and removes any remaining DAL directory directly. An idle buffer's expected shutdown interruption no longer emits that warning; an interruption while the buffer is open still does. ### Implementation - Move close-and-remove handling into `DeletionResourceManager.closeAndRemoveDAL(groupId)` so callers do not need to create a manager to clean up a region. Preserve the existing non-IoTConsensusV2 guard and close-before-directory-removal order. - Check `isClosed` before logging the interrupted initial queue wait. Keep the interrupt flag and existing persistence/draining behavior. - Add regression coverage for absent managers, orphaned DAL directories, existing-manager cleanup and recreation, normal idle shutdown, and unexpected interruption. ### Validation - `mvn spotless:apply -pl iotdb-core/datanode` (JDK 17): passed. - Recompiled the changed manager/buffer sources and the two affected test classes against the locally cached test dependencies, then ran JUnitCore: **10 tests passed**. - Re-ran the buffer tests against the unmodified master buffer: the new normal-close warning regression test fails as expected. - Independently compiled the changed manager/buffer sources with both English and Chinese message classes. - The targeted Maven reactor run for `DeletionResourceManagerCleanupTest,PageCacheDeletionBufferTest,DeletionResourceTest,DeletionRecoverTest` is still running locally; final result will be added here. No cluster integration test has been run. This PR has: - [x] been self-reviewed. - [x] added comments/Javadoc for the cleanup and shutdown behavior. - [x] added unit tests for the affected paths. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
