Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Add tests for the cases that ReplicatedLog::validateOffsetAndEpoch needs to cover. This include:
- epoch > last known epoch => return diverging(log.endOffset, log.lastFetchedEpoch)
- epoch < oldest snapshot epoch => return snapshot(latestSnapshotId)
- epoch == oldest snapshot epoch:
- offset < oldest snapshot offset => return snapshot(latestSnapshotId)
- offset == oldest snapshot offset => return valid
- Now look up end offset for epoch:
- epoch unknown, less than the last known epoch and greater oldest snapshot epoch => return diverging(endOffset/epoch)
- found epoch in the log; end offset < offset => return diverging(endOffset/epoch)
- valid