Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
k/metadata: guesstimate leader when information is not yet present
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> (cherry picked from commit 7a60b75)
- Loading branch information