Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raft: reject linearizable_barrier if not is_leader() #10921

Merged
merged 1 commit into from
May 24, 2023

Conversation

jcsp
Copy link
Contributor

@jcsp jcsp commented May 22, 2023

A test noticed that a Kafka ListOffsets request issued concurrently with raft election could return a commit_index lower than the last message committed on the previous leader.

To the client this looks like time travel on their topic's HWM.

We could special case this for ListOffsets, but linearizable_barrier is used lots of places, and probably none of them actually want to run in this brief millisecond between leader election and is_leader() becoming true.

Fixes #10885

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.1.x
  • v22.3.x
  • v22.2.x

Release Notes

Bug Fixes

  • An issue is fixed where clients might see a lower partition high watermark than expected if querying very soon after a new raft leader is elected for the partition.

@jcsp jcsp added kind/bug Something isn't working area/raft labels May 22, 2023
@jcsp jcsp requested a review from mmaslankaprv May 22, 2023 13:35
A test noticed that a Kafka ListOffsets request issued
concurrently with raft election could return a commit_index
lower than the last message committed on the previous leader.

To the client this looks like time travel on their topic's HWM.

We could special case this for ListOffsets, but linearizable_barrier
is used lots of places, and probably none of them actually want to run
in this brief millisecond between leader election and is_leader()
becoming true.

Fixes redpanda-data#10885
@jcsp jcsp force-pushed the issue-10885-raft-is-elected branch from fb58463 to d170fc6 Compare May 22, 2023 14:05
@jcsp jcsp requested a review from mmaslankaprv May 22, 2023 14:05
@jcsp jcsp marked this pull request as ready for review May 22, 2023 14:05
@jcsp jcsp merged commit f39fe25 into redpanda-data:dev May 24, 2023
@jcsp jcsp deleted the issue-10885-raft-is-elected branch May 24, 2023 13:22
@vbotbuildovich
Copy link
Collaborator

/backport v23.1.x

@vbotbuildovich
Copy link
Collaborator

/backport v22.3.x

@vbotbuildovich
Copy link
Collaborator

/backport v22.2.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI Failure (bad offset) in TopicRecoveryTest.test_time_based_retention
3 participants