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

   ## Description
   
   When a subscription tablet batch contains multiple historical TsFiles from 
the same pipe region, exhausting one file leaves its parser reservation held 
until the response is ACKed. With the per-pipe-region parser limit set to 1, 
opening the next file in that batch repeatedly waits for parser memory and 
times out, delaying snapshot delivery.
   
   Close the current TsFile event as soon as its tablet iterator is exhausted, 
including files filtered to zero tablets. Keep the parsed tablet event 
references in the iteration snapshot until ACK or cleanup, so releasing the 
parser does not release tablets still needed by the response.
   
   ## Validation
   
   - Added table-model regression tests using real TsFiles for consecutive 
files in one region before ACK, a filtered file producing no tablets, and 
forced cleanup of a partially parsed file with a detached iteration snapshot. 
The tests also check tablet contents and tablet-memory release.
   - A local baseline run on the release branch with the unchanged iterator 
lifecycle reproduced both reservation-release failures: 3 tests, 2 failures, 1 
pass.
   - Spotless formatting completed for both changed Java files; `git diff 
--check` passed.
   - **Post-fix tests have not completed.** Maven compilation attempts on the 
release-based working tree failed from Windows/JVM memory exhaustion before 
test execution. After transplanting the patch and adapting the test constructor 
to `master`, compilation and tests were not rerun locally. CI validation and 
the repeated snapshot cluster scenario remain pending.
   
   This PR has:
   
   - [x] been self-reviewed, including the synchronized iterator and 
parser/tablet cleanup lifetimes.
   - [x] added comments explaining why exhausted parsers must close before 
batch ACK.
   - [x] added regression tests for the affected resource lifetimes.
   
   Key changed/added classes:
   
   - `SubscriptionPipeTabletEventBatch`
   - `SubscriptionPipeTabletEventBatchTest`
   


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