Skip to content

[TASK] Refactor: remove the inactive RedirectFilter master redirect #3245

Description

@byteayan

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:

GlobalMasterInfo globalNodeInfo = manager.globalNodeRoleInfo();
if (globalNodeInfo == null || !globalNodeInfo.supportElection()) {
return;
}

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 refactor(server): remove legacy master-worker scheduler code (phase 2) #3244 being merged first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions