Pengzna commented on code in PR #19321:
URL: https://github.com/apache/iotdb/pull/19321#discussion_r4627186446
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/DeletionResourceManager.java:
##########
@@ -176,7 +176,26 @@ public List<DeletionResource> getAllDeletionResources() {
}
}
- public void removeDAL() {
+ /** Close an existing manager and remove its DAL without creating a manager
for cleanup. */
+ public static void closeAndRemoveDAL(int groupId) {
+ if (DeletionResourceManagerHolder.CONSENSUS_GROUP_ID_2_INSTANCE_MAP ==
null) {
+ return;
+ }
+ final DeletionResourceManager manager =
+
DeletionResourceManagerHolder.CONSENSUS_GROUP_ID_2_INSTANCE_MAP.get(groupId);
+ if (manager != null) {
+ manager.close();
+ removeDAL(groupId, manager.storageDir);
+ } else {
+ removeDAL(
Review Comment:
Fixed in dd1a1211842c123403a125f088ece4b72ba106c2. `getInstance()` and
`closeAndRemoveDAL()` now share a stable region lifecycle lock, including the
constructor/recovery and the complete close/remove sequence. Cleanup also
leaves a deleted-region tombstone, cleared only by storage region creation, so
late tasks cannot recreate DAL after cleanup. Added latch-controlled
regressions that pause initialization before the map entry is published and
pause cleanup after manager close but before directory removal; competing
cleanup/creation must wait, and creation is rejected after deletion.
--
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]