showuon commented on PR #15947:
URL: https://github.com/apache/kafka/pull/15947#issuecomment-2112378322

   @kamalcph ,
   > If there are some segments to upload from the dirB, will the 
log#highestOffsetInRemoteStorage updated?
   
   Yes, it will! That means, the inconsistent state will be fixed after next 
log segment copied to remote from dirB.
   
   > Trying to understand how the issue surfaced with the AlterLogDirTest, 
there we had one log segment (002.log) to upload post the alterLogDir operation.
   
   Yes, it should not have the issue, but in edge case, there's a race 
condition like this:
   1. alter from dirA to dirB completed, but leader is still in dirA because we 
need to wait until controller update metadata log
   2. The condition we're waiting for alterLogDirAction is that when the dirB 
contains logs, and dirA is gone, we consider it is completed
   3. We started to produce data to the topic, and dirB (follower) is 
replicating 002.log from dirA(leader)
   4. log segment 002.log is uploaded to remote (in dirA)
   5. received leadership change to the dirB, and now it doesn't have any logs 
to uploaded.
   6. The earliest offset check failed for dirB (expect 3, but it's 2 since 
002.log is existed)


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to