byteayan opened a new pull request, #3244:
URL: https://github.com/apache/hugegraph/pull/3244

   ## Purpose of the PR
   
   - close #3086
   
   #3082 turned off the pre-PD master-worker scheduler but left the role 
election wiring, the deprecated config handling and ServerInfoManager's 
persistence path in place as compatibility scaffolding. This removes them.
   
   ## Main Changes
   
   Role election (first commit):
   - Delete the `masterelection` classes except `GlobalMasterInfo` (still used 
by `RedirectFilter`, `ServerInfoManager`, the Gremlin whitelist and examples), 
`StandardRoleListener`, and `RoleElectionStateMachineTest`.
   - Drop `HugeGraph.roleElectionStateMachine()` and its two implementations.
   - Remove `server.role_election` and the `server.role.*` options, including 
the `RegisterUtil` registration and the code in `GraphManager` and 
`StandardAuthenticator` that copied them into every graph config.
   - Remove the deprecation warnings #3082 added for `task.scheduler_type` and 
`server.role_election`.
   - Remove TaskManager's `task-scheduler` pool, `closeSchedulerTx()` and the 
`onAsRoleMaster/Worker` no-ops.
   
   Server info (second commit):
   - Delete `HugeServerInfo`.
   - Remove `ServerInfoManager.init()`, `heartbeat()`, `tx()`, `call()` and its 
db executor, plus the `server-info-db-worker` pool and the constructor 
parameter threaded through `StandardTaskScheduler`, `TaskAndResultScheduler` 
and `DistributedTaskScheduler`.
   
   Where this differs from the plan in the issue:
   - The issue says `DistributedTaskScheduler` uses 
`selfNodeId()`/`selfIsMaster()`. Nothing calls them today; I kept them anyway 
since `ServerInfoManager` and `TaskScheduler.serverManager()` stay.
   - There was no `initSchemaIfNeeded()` call for `HugeServerInfo` to remove.
   - `HugeVertex.type()` still maps `~server` and `~role_data` to 
`HugeType.SERVER`, now through string literals, so vertices left in existing 
graphs keep routing to the same table on hstore.
   - The two transition tests are kept and renamed instead of deleted. They now 
check that a graph still opens with `task.scheduler_type` set, and that 
`GraphManager` starts and applies `server.role` when the removed role election 
keys are present.
   
   Upgrade note: a config that still sets a removed key starts normally; 
HugeConfig logs its "redundant option" warning for that key.
   
   Left for a follow-up: `GlobalMasterInfo.supportElection` is never set to 
true any more, so the redirect branch in `RedirectFilter` is dead, and 
`GraphTransaction.queryServerInfos()` has no callers.
   
   ## 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)*.
   - [x] Need tests and can be verified as follows:
       - `TaskSchedulerServerInfoTest.testLegacyServerLabelsKeepServerType` 
checks the legacy label mapping in `HugeVertex`
       - 
`TaskSchedulerServerInfoTest.testGraphManagerIgnoresRemovedRoleElectionOptions` 
and `MultiGraphsTest.testOpenGraphWithRemovedTaskSchedulerType` cover old 
config keys
       - Ran locally on JDK 11: the full `UnitTestSuite` (747 run, 0 failures) 
and the rocksdb core tests `TaskAndResultSchedulerTest`, `MultiGraphsTest`, 
`TaskCoreTest` (30 run, 0 failures)
   
   ## 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))
   - [x]  Modify configurations
   - [x]  The public API
   - [ ]  Other affects (typed here)
   - [ ]  Nope
   
   "The public API" here is the Java `HugeGraph` interface losing 
`roleElectionStateMachine()`; no REST endpoint changes.
   
   ## Documentation Status
   
   Select one option and provide the documentation location when applicable.
   
   - [ ] `Doc - TODO`: required documentation is pending; complete it before 
merging.
   - [x] `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:
   Paired hugegraph-doc PR: DOC_PR_LINK (removes `server.role_election` and the 
`server.role.*` block from `content/{en,cn}/docs/config/config-option.md`). 
Please merge both together.
   


-- 
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]

Reply via email to