Skip to content

Make every master task a ClusterStateTaskListener #82644

Closed
@DaveCTurner

Description

@DaveCTurner

Today almost every task executed by the master implements ClusterStateTaskListener, but this isn't required by the API and there are a few tasks which pass in a separate listener instead. It'd open the door to some simplifications if we could change the API to remove the ability to pass a separate listener. This issue tracks the tasks that need changing for this refactoring:

In each case the goal is to change a call to MasterService#submitStateUpdateTask to take the same object for task and listener parameters. I believe we can just add a ActionListener<Void> field to JoinTaskExecutor#Task and NodeRemovalClusterStateTaskExecutor#Task, but the other ones are used in other contexts so I think it makes sense to wrap each one in a separate task object which pairs the existing object with a new listener, and adjust the executor to match.

IMO it seems wise to do these steps as separate PRs since most of these cases trigger quite a few knock-on changes in tests etc. and it'll be easier to review each step in isolation.

These are all the ones I can see from a quick look through the code but the last step may identify other tasks that need the same treatment.

Metadata

Metadata

Assignees

Labels

:Distributed Coordination/Cluster CoordinationCluster formation and cluster state publication, including cluster membership and fault detection.>refactoringTeam:Distributed (Obsolete)Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions