Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
For a partition p0 and a given leader epoch, the remote log manager can upload duplicate segments due to leader change. RemoteLogMetadata cache should handle the duplicate segments which may affect the follower and consumer.
(eg)
L0 uploaded the segment PZyYVdsJQWeBAdBDPqkcVA at t0 for offset range 10 - 90
L1 uploads the segment L5Ufv71IToiZYKgsluzcyA at t1 for offset range 5 - 100
In the RemoteLogLeaderEpochState class, the offsetToId is a navigable map. It sorts the entries by start-offset which keeps the state as:
(5 - 100) -> L5Ufv71IToiZYKgsluzcyA (T1) (10 - 90) -> PZyYVdsJQWeBAdBDPqkcVA (T0)
For a fetch request with fetch-offset as 92, the RemoteLogLeaderEpochState will return the segment PZyYVdsJQWeBAdBDPqkcVA instead of L5Ufv71IToiZYKgsluzcyA, which doesn't have the respective offset and throws error back to the caller.
Attachments
Issue Links
- links to