Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[TASK] Refactor: remove the inactive RedirectFilter master redirect

オープン
#3,245 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
api, backend, database

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Java
スター
3.2k
フォーク
637
平均マージ
3日 21時間
マージ済み PR(30日)
21

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/hugegraph のほかの issue

apache/hugegraph の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。