You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Caideyipi (via GitHub)" <gi...@apache.org> on 2026/10/15 09:44:52 UTC

[PR] Reuse DataRegion insert lock for IoTConsensus shutdown fencing [iotdb]

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

   ## Description
   
   Follow up to #18841. IoTConsensus shutdown fencing currently acquires an additional region read/write lock around every apply. Reuse `DataRegion.insertLock` to check write admission and permanently close admission before storage and WAL shutdown. Memory backpressure and state-machine retry waits stay outside the insert lock.
   
   Write successful insertions' WAL separators before releasing the insert lock, preserving their subscription metadata. Table deletions continue to release the lock during sealed-file I/O. Shutdown waits on a condition from the same lock until admitted deletions finish, including separator emission on success; failed deletions also unblock shutdown. Remove the state-machine apply wrapper.
   
   ## Validation
   
   - Targeted tests: `IoTConsensusShutdownTest`, `DataRegionTest`, `DataRegionStateMachineTest`, `WALNodeTest`, and `testCompactionWithDeletionsDuringCompactions` in both `InnerSeqCompactionWithFastPerformerTest` and `InnerSeqCompactionWithReadChunkPerformerTest` (74 tests, 0 failures/errors, 1 existing skip).
   - Shutdown tests cover writers queued for the insert lock, admitted writes and pending WAL separators, memory backpressure, all storage write paths, unlocked table deletion I/O and failure, and other consensus protocols.
   - Full reactor test compilation in English and Chinese: `mvn test-compile -DskipTests` and `mvn test-compile -P with-zh-locale -DskipTests`.
   - `mvn spotless:apply -pl iotdb-core/datanode`.
   
   This PR has:
   
   - [x] been self-reviewed for concurrent writes and shutdown.
   - [x] added or updated unit tests for the changed write and shutdown paths.
   - [x] added comments explaining the lock and deletion-draining behavior.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Reuse DataRegion insert lock for IoTConsensus shutdown fencing [iotdb]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #18893:
URL: https://github.com/apache/iotdb/pull/18893


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org