Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-10310 Kafka Raft Snapshot
  3. KAFKA-12253

Add tests that cover all of all of the cases for ReplicatedLog::validateOffsetAndEpoch

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • replication
    • None

    Description

      Add tests for the cases that ReplicatedLog::validateOffsetAndEpoch needs to cover. This include:

       

      1. epoch > last known epoch =>  return diverging(log.endOffset, log.lastFetchedEpoch)
      2. epoch < oldest snapshot epoch => return snapshot(latestSnapshotId)
      3. epoch == oldest snapshot epoch:
        1. offset < oldest snapshot offset => return snapshot(latestSnapshotId)
        2. offset == oldest snapshot offset => return valid
      4. Now look up end offset for epoch:
        1. epoch unknown, less than the last known epoch and greater oldest snapshot epoch => return diverging(endOffset/epoch)
        2. found epoch in the log; end offset < offset => return diverging(endOffset/epoch)
        3. valid

      Attachments

        Activity

          People

            rohitdeshaws Rohit Deshpande
            jagsancio Jose Armando Garcia Sancio
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: