Tanuj Khurana created PHOENIX-7984:
--------------------------------------

             Summary: Fence writer on sync failure to prevent false-success RPO 
loss
                 Key: PHOENIX-7984
                 URL: https://issues.apache.org/jira/browse/PHOENIX-7984
             Project: Phoenix
          Issue Type: Sub-task
            Reporter: Tanuj Khurana
            Assignee: Tanuj Khurana


A block-full or explicit sync() that fails after closeBlock() has already 
advanced block state leaves the LogFileWriter in a torn-down state. A 
subsequent retry sync() then finds nothing left to flush and returns success — 
a false ACK. That false ACK clears currentBatch, silently dropping the unsynced 
records (RPO loss). The retry succeeds against a writer whose durability 
barrier was never actually crossed.

Fix (mirroring HDFS DFSOutputStream single-shot semantics)

  - LogFileWriter: latch the first append/sync failure. Every subsequent 
append/sync fails fast rather than re-driving the already torn-down stream, so 
a fenced writer can never report false success.
  - ReplicationLog.apply(): a retry is only meaningful on a fresh writer. On 
failure, request rotation; if no fresh writer can be staged, surface the 
original failure instead of burning a retry attempt on the fenced writer.

Recovery remains the higher layer's responsibility: rotate to a fresh writer 
and replay the unsynced batch. The failing event's own record is recovered via 
replayFailedEvent.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to