tkhurana opened a new pull request, #2485:
URL: https://github.com/apache/phoenix/pull/2485

   ## Summary
   
   - Move `requestRotationIfNeeded()` out of `apply()` so the size check only 
runs after `currentBatch` is cleared. Pre-fix, when a rotation staged a new 
writer mid-batch, replaying unsynced records into the new writer could push it 
over the threshold and trigger another rotation on every subsequent append, 
forming a cascading loop.
   - Short-circuit `requestRotationIfNeeded()` when the log is closed or a 
rotation is already pending, so it cannot stack up requests during in-flight 
rotations.
   - Clear `rotationRequested` at the end of the rotation task (in `finally`) 
instead of at the start. This way duplicate on-demand rotation submissions are 
rejected by the CAS in `requestRotation()` while the task is still 
creating/staging the new writer.
   
   ## Test plan
   
   - [x] `mvn spotless:apply`
   - [x] New unit test 
`ReplicationLogGroupTest#testSizeRotationDoesNotLoopOnReplay` reproduces the 
cascading-rotation behavior on the buggy code (writer-per-append) and asserts a 
bounded count after the fix
   - [ ] `mvn test -pl phoenix-core -Dtest=ReplicationLogGroupTest`


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