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

k/metadata: guesstimate leader when information is not yet present #15981

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Jan 6, 2024

When partition is first created in Redpanda some of the cluster nodes which are not hosting partition replicas may not yet have leadership metadata. In this case Redpanda still has to return partition metadata. In order not to disturb the client (returning -1 as a leader id may cause some clients to stop) Redpanda has to return a leader id. If the information is not present we will always return the first node from replica set in leader epoch equal to 0. This way client will either communicate with the actual leader or issue a metadata request to other node that may contain up to date information.

Fixes: #15949
Fixes: #15972

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.3.x
  • v23.2.x
  • v23.1.x

Release Notes

  • none

When partition is first created in Redpanda some of the cluster nodes
which are not hosting partition replicas may not yet have leadership
metadata. In this case Redpanda still has to return partition metadata.
In order not to disturb the client (returning -1 as a leader id may
cause some clients to stop) Redpanda has to return a leader id. If the
information is not present we will always return the first node from
replica set in leader epoch equal to 0. This way client will either
communicate with the actual leader or issue a metadata request to other
node that may contain up to date information.

Fixes: redpanda-data#15949

Signed-off-by: Michal Maslanka <michal@redpanda.com>
@vbotbuildovich
Copy link
Collaborator

@ztlpn
Copy link
Contributor

ztlpn commented Jan 8, 2024

/ci-repeat 2
skip-units
skip-redpanda-build
dt-repeat=20
tests/rptest/tests/recovery_mode_test.py::DisablingPartitionsTest.test_disable

@mmaslankaprv mmaslankaprv merged commit 94e4068 into redpanda-data:dev Jan 8, 2024
22 of 23 checks passed
@mmaslankaprv mmaslankaprv deleted the fix-15949 branch January 8, 2024 15:35
@andijcr
Copy link
Contributor

andijcr commented Jan 26, 2024

this should also be backported to v23.3.x since it was backported to v23.2.x

@piyushredpanda
Copy link
Contributor

/backport v23.3.x

@vbotbuildovich
Copy link
Collaborator

Oops! Something went wrong.

Workflow run logs.

@piyushredpanda
Copy link
Contributor

@mmaslankaprv ^

@mmaslankaprv
Copy link
Member Author

/backport v23.3.x

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