Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Improving cluster state updates by concurrently executing appliers and listeners #15987

Open
jainankitk opened this issue Sep 19, 2024 · 0 comments
Labels
Cluster Manager enhancement Enhancement or improvement to existing feature or request untriaged

Comments

@jainankitk
Copy link
Collaborator

Is your feature request related to a problem? Please describe

I am wondering if the ClusterStateAppliers and ClusterStateListeners need to be single threaded. While consuming single ClusterChangedEvent, we can execute all the appliers and listeners in parallel, given there is no implicit guarantee on the order of these appliers and listeners anyway. For example:

for (ClusterStateApplier applier : clusterStateAppliers) {
    logger.trace("calling [{}] with change to version [{}]", applier, clusterChangedEvent.state().version());
    try (TimingHandle ignored = stopWatch.timing("running applier [" + applier + "]")) {
        long applierStartTimeNS = System.nanoTime();
        // Execute all the appliers in parallel using separate threadpool
        applier.applyClusterState(clusterChangedEvent);
    }
// wait for all appliers to finish executing to prevent cluster state update thread to consume next event
// record latency for the cluster state applier operation
}

We can do same thing for listeners as well. Am I missing something?

Describe the solution you'd like

Execute all the appliers and listeners concurrently

Related component

Cluster Manager

Describe alternatives you've considered

No response

Additional context

No response

@jainankitk jainankitk added enhancement Enhancement or improvement to existing feature or request untriaged labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cluster Manager enhancement Enhancement or improvement to existing feature or request untriaged
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant