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

[TASK] Refactor: remove the inactive RedirectFilter master redirect

Abierto
#3,245 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
api, backend, database

Línea de trabajo

First confirm that #3244 is merged, then inspect RedirectFilter.java, RedirectFilterDynamicFeature, ApplicationConfig, GlobalMasterInfo, and GraphTransaction. Run AccessLogFilterTest, including testRedirectRunsAfterBodyCapture, before and after the cleanup. Done means the unused redirect and server-info paths are removed while the listed node-role behavior, REST behavior, and HugeType.SERVER mappings remain.

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

Descripción

Background

Follow-up to #3086 / #3244. RedirectFilter forwards requests for endpoints annotated with @RedirectFilter.RedirectMasterRole to the elected master node. It only acts when GlobalMasterInfo.supportElection() is true:

https://github.com/apache/hugegraph/blob/2f827d6e8c9c62ae858f2fc122b3a192d015e2f4/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/RedirectFilter.java#L85-L88

The only code that set it to true was GraphManager.initRoleStateMachine(), which nothing has called since #3082. #3244 deletes that method together with the rest of the role election code, so no code path can enable the flag. The filter is still registered on the 21 schema, job, task and raft endpoint methods that carry the annotation and returns early on every request.

GraphTransaction.queryServerInfos(...) is in the same state. It read the ~server vertices that HugeServerInfo used to write, and it has no callers.

Scope

  • Delete RedirectFilter, RedirectFilterDynamicFeature, the RedirectMasterRole annotation on the endpoints that use it, and the registration in ApplicationConfig. Drop AccessLogFilterTest.testRedirectRunsAfterBodyCapture.
  • Remove supportElection, masterInfo(...), resetMasterInfo(), NodeInfo and the stale "delete the startup of master-worker" TODO from GlobalMasterInfo. Keep the node id and node role parts, which ServerInfoManager and GraphManager still use.
  • Delete both GraphTransaction.queryServerInfos(...) overloads.

Constraints

  • No REST behavior changes, since the redirect never runs today. The x-hg-redirect header would simply stop being recognised.
  • Keep HugeType.SERVER and the ~server / ~role_data label mapping in HugeVertex, because graphs written by older versions may still hold those vertices.
  • Depends on #3244 being merged first.
Lenguaje dominante
Java
Estrellas
3.2k
Forks
637
Merge medio
3 d 21 h
PR fusionados (30 d)
21

Preparar el entorno

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/hugegraph

Todos los issues de apache/hugegraph

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.