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

   ## Description
   
   Backport of #18305 to `dev/1.3`.
   
   This PR also includes #18260 as a required prerequisite because `dev/1.3` 
does not yet contain the fair TsFile parser admission API used by the original 
fix. The prerequisite and follow-up fix remain as two separate commits.
   
   ### Preserve fairness across temporary queue gaps
   
   The TsFile parser scheduler removed a single-region Pipe from the waiting 
order after admitting its only pending request. If that Pipe re-entered while a 
multi-region Pipe still had queued requests, queue insertion order could give 
the multi-region Pipe consecutive admissions. This change keeps a pipe-level 
admission cursor across temporary gaps, advances it only for requests that 
actually waited, and clears it once parser reservations and waiters are both 
idle.
   
   ### Preserve scan parser state on critical OOM
   
   A critical OOM while resizing memory for the next Tablet was handled by the 
generic exception path, which closed the scan parser even though the current 
data had not been consumed. The scan container now propagates this retryable 
OOM without closing so the caller can yield the parser slot and retry from the 
same iterator position. Other exceptions retain the existing close-and-wrap 
behavior.
   
   This also preserves the two parser diagnostics required by the V1-498 test 
procedure:
   
   - `failed to consume parsed tablet from TsFile`
   - `failed to allocate memory for parsing TsFile`
   
   ### Verification
   
   - `.\mvnw.cmd clean test -pl iotdb-core/datanode -am 
'-Dtest=PipeMemoryManagerTest,TsFileInsertionDataContainerTest' 
'-Dsurefire.failIfNoSpecifiedTests=false' '-DskipITs' '-Ddevelocity.off=true'`
   - Targeted suite: 22 tests, 0 failures, 0 errors.
   - Checkstyle and Spotless checks passed as part of the reactor build.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining non-obvious scheduling decisions.
   - [x] added unit tests for the new admission and retry paths.
   
   <hr>
   
   ##### Key changed/added classes
   
   - `PipeMemoryManager`
   - `PipeTsFileInsertionEvent`
   - `TsFileInsertionScanDataContainer`
   - `PipeMemoryManagerTest`
   - `TsFileInsertionDataContainerTest`


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