Skip to content

[Pipe] Preserve parser fairness and OOM retry state#18305

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/pipe-parser-fairness-retry-master
Open

[Pipe] Preserve parser fairness and OOM retry state#18305
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/pipe-parser-fairness-retry-master

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

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

Verification

  • Added a scheduler regression test covering a single-region Pipe that temporarily leaves and re-enters the waiting queue.
  • Added a scan parser regression test that injects critical OOM during iterator.next() and verifies the same iterator can subsequently produce the event.
  • mvnw.cmd clean test -pl iotdb-core/datanode -am -Dtest=PipeMemoryManagerTest,TsFileInsertionEventParserTest -Dsurefire.failIfNoSpecifiedTests=false -DskipITs
    • TsFileInsertionEventParserTest: 21 run, 0 failures, 0 errors, 3 existing conditional skips.
    • PipeMemoryManagerTest: 8 run, 0 failures, 0 errors.
  • mvnw.cmd -pl iotdb-core/datanode spotless:apply

This PR has:

  • been self-reviewed.
  • added comments explaining the intent where it would not be obvious.
  • added unit tests to cover the new code paths.

Key changed/added classes
  • PipeMemoryManager
  • TsFileInsertionEventScanParser
  • PipeMemoryManagerTest
  • TsFileInsertionEventParserTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants