Conversation
Nothing has started the role election state machine since apache#3082. Graphs started with a node id (tests, examples, and Gremlin scripts calling serverStarted(GlobalMasterInfo.master(...))) still built one, which wrote ~role_data schema and leaked an idle executor. TaskManager also kept the task-scheduler pool alive only to close transactions on it. Remove the masterelection classes other than GlobalMasterInfo, the HugeGraph.roleElectionStateMachine() accessor, the server.role_election and server.role.* options, the deprecation warnings added in apache#3082, and TaskManager's scheduler pool and role callbacks. Old config files that still set the removed keys only get HugeConfig's "redundant option" warning. HugeVertex keeps mapping the ~role_data label to HugeType.SERVER so vertices left in existing graphs still route to the same table.
ServerInfoManager.init() and heartbeat() have been no-ops since apache#3082, and tx()/call() had no callers, so the server-info-db-worker pool that backed them never ran anything. Remove those methods, the executor, the constructor parameter threaded through the task schedulers, and the HugeServerInfo vertex class. ServerInfoManager itself stays: StandardHugeGraph still hands it the node info, and TaskScheduler.serverManager() is part of the interface.
RedirectFilter only forwarded requests when GlobalMasterInfo.supportElection() was true, and the only code that set it was the role election path removed in apache#3244, which nothing had called since apache#3082. The filter was still registered on 21 endpoint methods and returned early on every request. Remove RedirectFilter, RedirectFilterDynamicFeature and the @RedirectMasterRole annotations, the election and master URL state in GlobalMasterInfo, and GraphTransaction.queryServerInfos(), which read the ~server vertices HugeServerInfo used to write and had no callers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the PR
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.
RedirectFilterforwarded requests to the elected master only whenGlobalMasterInfo.supportElection()was true. The only code that set the flag wasGraphManager.initRoleStateMachine(), which nothing has called since #3082 and which #3244 deletes. The filter was still registered on 21 endpoint methods through@RedirectMasterRoleand returned early on every request.Main Changes
RedirectFilter,RedirectFilterDynamicFeature, the@RedirectFilter.RedirectMasterRoleannotations on the schema, job, task and raft APIs, and the registration inApplicationConfig.GlobalMasterInfoto the node id and node role.supportElection, the masterNodeInfo,masterInfo(...),resetMasterInfo()and the stale master-worker TODO are gone.GlobalMasterInfo.master(...)stays, since tests, the example and the Gremlin scripts use it.GraphTransaction.queryServerInfos(...)overloads. They read the~serververtices thatHugeServerInfoused to write and had no callers.AccessLogFilterTest.testRedirectRunsAfterBodyCapture, which only checked the removed filter's registration priority.HugeType.SERVERand the legacy~server/~role_datalabel mapping inHugeVertexare unchanged.Verifying these changes
Ran the full
UnitTestSuitelocally 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?
"The public API" here means the Java
GlobalMasterInfoandGraphTransactionmethods listed above. The REST endpoints respond as before because the redirect never ran. Thex-hg-redirectheader 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.Doc - No Need: no user-visible documentation is affected.Documentation files in this PR or paired hugegraph-doc PR: