CRZbulabula opened a new pull request, #18285:
URL: https://github.com/apache/iotdb/pull/18285

   ## Description
   
   Region creation and retry dispatch could race with database deletion, 
allowing stale Region creation work to survive after DROP or mutate missing 
metadata.
   
   This PR fixes the lifecycle entirely in ConfigNode:
   
   - introduces one database-name-scoped lifecycle lock manager shared by 
synchronous manager requests and Procedures;
   - fences database creation/alteration, RegionGroup allocation and creation, 
database deletion, and RegionMaintainer RPC dispatch with the same lock;
   - adds an idempotent Consensus plan that durably removes every queued 
RegionCreateTask for a pre-deleted database;
   - makes DeleteDatabaseProcedure retain its database lock while 
RemoveRegionGroupProcedure children delete all RegionGroups, deleting the 
partition table only afterward;
   - validates Region creation tasks immediately before dispatch and durably 
removes stale tasks;
   - repairs orphaned maintenance tasks when the ConfigNode leader starts;
   - limits Region creation batches per DataNode and Region type, performs one 
attempt per scheduling cycle, and adds exponential backoff, jitter, and 
direct-memory/OOM cooldown;
   - retries RegionGroup and RegionCreateTask persistence idempotently.
   
   The implementation is ConfigNode-only. It does not introduce database 
lifecycle generations and does not change the historical Procedure, plan, or 
PartitionInfo snapshot serialization formats.
   
   This also covers the useful ConfigNode race fixes discussed in #18273—atomic 
CreateRegionGroupsPlan validation, RegionGroup ID high-water-mark advancement, 
database lifecycle mutual exclusion, and pre-persistence cleanup—without adding 
generation fields to persisted formats.
   
   ## Tests
   
   - focused ConfigNode unit tests: 143 passed;
   - full English-locale reactor test-compile: passed;
   - full Chinese-locale reactor test-compile: passed;
   - Spotless and Checkstyle: passed.
   
   The tests cover durable batch cancellation, multiple failed replicas of one 
Region, same-name database recreation, stale/missing/pre-deleted database 
validation, child RegionGroup cleanup, transient Consensus retries, task-offer 
idempotency, database lock mutual exclusion/reentrancy, snapshot compatibility, 
and procedure serialization compatibility.
   
   This PR has:
   
   - [x] been self-reviewed
   - [x] added comments for concurrency and recovery behavior
   - [x] added or updated unit tests
   - [ ] added integration tests


-- 
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]

Reply via email to