Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[client] NotLeaderOrFollowerException persists when a stale TabletServer endpoint is reused

Abierto
#4,256 6 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@BackendArchitectX ya está trabajando en esto.

Desde el 9/9/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

Comience por el manejo en el cliente de las solicitudes listOffsets que reciben NotLeaderOrFollowerException y, a continuación, siga la caché de conexiones de server-UID y la ruta de actualización de los metadatos del clúster. Reproduzca la secuencia de endpoint obsoleto descrita en el issue y verifique que la conexión afectada y los metadatos de enrutamiento se invaliden, que los metadatos se actualicen, que los reintentos estén limitados y que un host o puerto cambiado reemplace la conexión almacenada en caché.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Search before asking
  • I searched in the issues and found nothing similar.
Fluss version

0.8.0

Please describe the bug 🐞

During a rolling upgrade, a TabletServer may restart with a new endpoint, while its old endpoint is reused by another TabletServer. A client may then keep a cached connection for the original server ID that actually connects to the other TabletServer.

A request such as listOffsets reaches the wrong server and receives NotLeaderOrFollowerException. The current handling completes the future exceptionally without disconnecting the cached connection or forcing a cluster metadata refresh. Subsequent caller-side retries reuse the same connection, making the failure persistent.

This is related to #2097 and #3389. Unlike the transient leader-change case described in #3389, the stale endpoint remains reachable because it now belongs to another TabletServer, so no NetworkException is raised to invalidate the connection.

Steps to reproduce

The following sequence illustrates how the problem occurs rather than requiring a deterministic IP-reuse setup:

  1. The client caches server A -> endpoint X.
  2. During a rolling upgrade, server A restarts at endpoint Y, and endpoint X is reused by server B.
  3. Before its membership metadata is refreshed, the client creates a connection for server A using endpoint X. The connection is cached under server A's UID, but its actual peer is server B.
  4. A later metadata refresh may update server A -> endpoint Y, but connection lookup still reuses the existing connection cached by server UID.
  5. Requests for buckets led by server A continue to reach server B and receive NotLeaderOrFollowerException.
  6. Because the exception does not invalidate or disconnect the cached connection, subsequent retries keep using the wrong connection.
Solution

On NotLeaderOrFollowerException, invalidate the affected routing metadata, disconnect the cached connection for the selected leader, refresh cluster metadata, and retry with a bounded retry count.

Also consider replacing an existing connection when the host or port changes for the same server UID.

Are you willing to submit a PR?
  • I'm willing to submit a PR!
Lenguaje dominante
Java
Estrellas
2.2k
Forks
646
Merge medio
2 d 28 min
PR fusionados (30 d)
128

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/fluss

Todos los issues de apache/fluss

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.