jt2594838 opened a new pull request, #18453:
URL: https://github.com/apache/iotdb/pull/18453
## Description
### Fix SyncStatus memory reservation retry
When the first batch fails to reserve consensus memory, its `SyncStatus` has
no pending batch whose completion can call `notifyAll()`. The dispatcher can
therefore wait indefinitely even after memory becomes available elsewhere.
This change separates pending-batch backpressure from memory reservation. A
full pending queue still waits for `removeBatch()` notification, while a failed
memory reservation waits for at least 1 ms using the configured basic retry
interval and then retries. It also preserves normal `InterruptedException`
semantics instead of clearing the interrupt and potentially enqueueing an
unreserved batch.
### Regression coverage
Adds a unit test with a memory block that rejects the first allocation and
accepts the second, verifying that the first batch progresses without an
external notification and that reserved memory is released afterward.
Validation:
- `mvn test -pl iotdb-core/consensus -Dtest=SyncStatusTest`
- `mvn test -pl iotdb-core/consensus -Dtest=SyncStatusTest -P with-zh-locale`
- Spotless and Checkstyle passed in both runs
<hr>
This PR has:
- [x] been self-reviewed.
- [x] concurrent write
- [x] added comments explaining the why and the intent of the code wherever
it would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for code coverage.
<hr>
##### Key changed/added classes
- `SyncStatus`: retry failed batch memory reservations without relying on
another batch to notify the monitor.
- `SyncStatusTest`: cover first-batch allocation failure and recovery.
--
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]