balodesecurity opened a new pull request, #8312:
URL: https://github.com/apache/hadoop/pull/8312

   ## Problem
   
   When `blockReceivedAndDeleted` RPC fails in 
`IncrementalBlockReportManager.sendIBRs()`, the `lastIBR` timestamp was only 
updated on success. A failed RPC left `lastIBR` stale, so `sendImmediately()` 
returned `true` on every subsequent heartbeat — the DataNode retried the IBR on 
every heartbeat cycle instead of waiting for the configured 
`dfs.blockreport.incremental.intervalMsec`.
   
   Under high NameNode load this creates a positive feedback loop: failures 
trigger immediate retries, which increase NameNode contention, which causes 
more failures.
   
   ## Fix
   
   Move `lastIBR = startTime` out of the `if (success)` branch into the 
unconditional `finally` block. Whether the RPC succeeds or fails, `lastIBR` is 
updated so the interval is always respected between attempts.
   
   ## Testing
   
   - Added `TestIncrementalBlockReports#testFailedIBRRespectsInterval`: creates 
an `IncrementalBlockReportManager` with a 60-second interval, injects a pending 
block, mocks the NameNode to throw `IOException`, calls `sendIBRs()`, and 
asserts `sendImmediately()` returns `false` immediately after the failure.
   - Test passes locally.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to