You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
Background
Follow-up to #3086 / #3244.
RedirectFilterforwards requests for endpoints annotated with@RedirectFilter.RedirectMasterRoleto the elected master node. It only acts whenGlobalMasterInfo.supportElection()is true:hugegraph/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/RedirectFilter.java
Lines 85 to 88 in 2f827d6
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~serververtices thatHugeServerInfoused to write, and it has no callers.Scope
RedirectFilter,RedirectFilterDynamicFeature, theRedirectMasterRoleannotation on the endpoints that use it, and the registration inApplicationConfig. DropAccessLogFilterTest.testRedirectRunsAfterBodyCapture.supportElection,masterInfo(...),resetMasterInfo(),NodeInfoand the stale "delete the startup of master-worker" TODO fromGlobalMasterInfo. Keep the node id and node role parts, whichServerInfoManagerandGraphManagerstill use.GraphTransaction.queryServerInfos(...)overloads.Constraints
x-hg-redirectheader would simply stop being recognised.HugeType.SERVERand the~server/~role_datalabel mapping inHugeVertex, because graphs written by older versions may still hold those vertices.