Skip to content

[TASK] Refactor: phase 2 cleanup — remove legacy master-worker scheduler dead code #3086

Description

@bitflicker64

Background

PR #3082 soft-disabled the pre-PD master-worker scheduling path and intentionally left
deprecated config handling, role-election wiring, and ServerInfoManager persistence as
compatibility scaffolding. This issue tracks the follow-up physical removal ("phase 2")
called out in the merge comment ("TODO: cleanup legacy code/configs in phrase2").

Scope of removal

1. Deprecated config warnings + transition tests (low risk)

  • task.scheduler_type warning block in StandardHugeGraph
  • ENABLE_SERVER_ROLE_ELECTION warning in GraphManager.initNodeRole()
  • ServerOptions.ENABLE_SERVER_ROLE_ELECTION config key declaration
  • Transition-only tests: testOpenGraphWithDeprecatedTaskSchedulerType and
    testGraphManagerWarnsOnRoleElection

2. Role election infrastructure (medium risk — touches HugeGraph interface)

All of the following are dead code — nothing starts the state machine after #3082:

  • StandardHugeGraph.initRoleStateMachine(Id) and the roleElectionStateMachine field
  • roleElectionStateMachine() from the HugeGraph interface and HugeGraphAuthProxy
  • GraphManager.initRoleStateMachine() and GraphManager.supportRoleElection() (never called)
  • StandardRoleListener class (never instantiated)
  • TaskManager.onAsRoleMaster() / onAsRoleWorker() no-ops
  • TaskManager.schedulerExecutor (task-scheduler-%d) zombie thread pool and closeSchedulerTx()
  • RoleElectionOptions config key declarations

3. ServerInfoManager dead persistence path + HugeServerInfo deletion (medium risk)

  • ServerInfoManager.init() (no-op), heartbeat() (no-op), tx(), call(), and the
    dbExecutor field — the live methods (selfNodeId, selfIsMaster, initServerInfo, etc.)
    must be kept since DistributedTaskScheduler still uses them
  • HugeServerInfo.java — entire class, including ~server vertex schema and load tracking
  • serverInfoDbExecutor thread pool and SERVER_INFO_DB_WORKER constant from TaskManager
  • serverInfoDbExecutor parameter from StandardTaskScheduler, TaskAndResultScheduler,
    and DistributedTaskScheduler constructors
  • Update ServerInfoManagerTest and TaskSchedulerServerInfoTest accordingly

Suggested PR split

PR Scope Risk
PR A Deprecated config warnings + transition tests Low
PR B Role election infrastructure Medium
PR C ServerInfoManager surgery + HugeServerInfo deletion Medium

Important constraints

  • ServerInfoManager itself is not deleted — DistributedTaskScheduler still uses
    selfNodeId() for task lock scoping.
  • TaskScheduler.serverManager() interface method stays for the same reason.
  • StandardHugeGraph.serverStarted() must keep the initServerInfo(nodeInfo) call —
    only the initRoleStateMachine(nodeInfo.nodeId()) call is removed.
  • Before deleting HugeServerInfo, audit HugeVertex.java for fromVertex dispatch
    references and any initSchemaIfNeeded() call sites in system init.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions