You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "haung921209 (via GitHub)" <gi...@apache.org> on 2026/08/19 23:49:31 UTC

[PR] KAFKA-20770: Return UNDEFINED_EPOCH from LocalLeaderEndPoint when the epoch cannot be resolved [kafka]

haung921209 opened a new pull request, #23202:
URL: https://github.com/apache/kafka/pull/23202

   LocalLeaderEndPoint falls back to epoch 0 when the leader epoch cache cannot
   resolve an epoch for the queried offset, while RemoteLeaderEndPoint (via
   ListOffsets) reports -1 in the same case. Epoch 0 is meaningful to
   TierStateMachine#buildRemoteLogAuxState, which short-circuits the
   earlier-epoch lookup on epoch 0 instead of failing the aux state build
   explicitly. This PR aligns the local path with the remote one by falling back
   to UNDEFINED_EPOCH (-1) in the four offset fetch methods, and adds a unit
   test that exercises the unresolvable-epoch case for all four.
   
   Jira: https://issues.apache.org/jira/browse/KAFKA-20770
   
   ### Testing
   
   - New unit test `testFetchOffsetsReturnUndefinedEpochWhenEpochIsUnresolvable`
     fails before the fix (`expected epoch=-1 but was epoch=0`) and passes after.
   - Targeted suites green: LocalLeaderEndPointTest, RemoteLeaderEndPointTest,
     ReplicaAlterLogDirsThreadTest, AbstractFetcherThreadTest,
     TierStateMachineTest, ReplicaFetcherThreadTest (156 tests, 0 failures).
   


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20770: Return UNDEFINED_EPOCH from LocalLeaderEndPoint when the epoch cannot be resolved [kafka]

Posted by "haung921209 (via GitHub)" <gi...@apache.org>.
haung921209 closed pull request #23202: KAFKA-20770: Return UNDEFINED_EPOCH from LocalLeaderEndPoint when the epoch cannot be resolved
URL: https://github.com/apache/kafka/pull/23202


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20770: Return UNDEFINED_EPOCH from LocalLeaderEndPoint when the epoch cannot be resolved [kafka]

Posted by "haung921209 (via GitHub)" <gi...@apache.org>.
haung921209 commented on PR #23202:
URL: https://github.com/apache/kafka/pull/23202#issuecomment-5351590478

   Closing in favor of #22756, which predates this PR by six weeks and contains the same production change with broader test coverage (including the cleanup of the implementation-mirroring assertions that this PR deliberately left out). I checked JIRA for an assignee before opening this but missed the existing PR — sorry for the noise, and credit to @SEPURI-SAI-KRISHNA for getting there first.


-- 
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-unsubscribe@kafka.apache.org

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