byteayan opened a new pull request, #3246:
URL: https://github.com/apache/hugegraph/pull/3246
## Purpose of the PR
- close #3245
Stacked on #3244: the first two commits here belong to that PR, and only the
last commit is new. I'll rebase onto master once #3244 merges.
`RedirectFilter` forwarded requests to the elected master only when
`GlobalMasterInfo.supportElection()` was true. The only code that set the flag
was `GraphManager.initRoleStateMachine()`, which nothing has called since #3082
and which #3244 deletes. The filter was still registered on 21 endpoint methods
through `@RedirectMasterRole` and returned early on every request.
## Main Changes
- Delete `RedirectFilter`, `RedirectFilterDynamicFeature`, the
`@RedirectFilter.RedirectMasterRole` annotations on the schema, job, task and
raft APIs, and the registration in `ApplicationConfig`.
- Reduce `GlobalMasterInfo` to the node id and node role. `supportElection`,
the master `NodeInfo`, `masterInfo(...)`, `resetMasterInfo()` and the stale
master-worker TODO are gone. `GlobalMasterInfo.master(...)` stays, since tests,
the example and the Gremlin scripts use it.
- Delete both `GraphTransaction.queryServerInfos(...)` overloads. They read
the `~server` vertices that `HugeServerInfo` used to write and had no callers.
- Drop `AccessLogFilterTest.testRedirectRunsAfterBodyCapture`, which only
checked the removed filter's registration priority.
`HugeType.SERVER` and the legacy `~server` / `~role_data` label mapping in
`HugeVertex` are unchanged.
## Verifying these changes
- [ ] Trivial rework / code cleanup without any test coverage. (No Need)
- [x] Already covered by existing tests, such as *(please modify tests
here)*.
- [ ] Need tests and can be verified as follows:
- xxx
Ran the full `UnitTestSuite` locally on JDK 11 (746 run, 0 failures). The
API tests, which exercise the annotated endpoints, were left to CI.
## Does this PR potentially affect the following parts?
- [ ] Dependencies ([add/update
license](https://hugegraph.apache.org/docs/contribution-guidelines/contribute/#321-check-licenses)
info &
[regenerate_known_dependencies.sh](../install-dist/scripts/dependency/regenerate_known_dependencies.sh))
- [ ] Modify configurations
- [x] The public API
- [ ] Other affects (typed here)
- [ ] Nope
"The public API" here means the Java `GlobalMasterInfo` and
`GraphTransaction` methods listed above. The REST endpoints respond as before
because the redirect never ran. The `x-hg-redirect` header only told the filter
to skip forwarding, so ignoring it changes nothing either.
## Documentation Status
Select one option and provide the documentation location when applicable.
- [ ] `Doc - TODO`: required documentation is pending; complete it before
merging.
- [ ] `Doc - Done`: documentation is included here or linked below.
- [x] `Doc - No Need`: no user-visible documentation is affected.
Documentation files in this PR or paired hugegraph-doc PR:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]