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

Remove LegacyCTRAListener from MetadataUpdateSettingsService #84985

Conversation

arteam
Copy link
Contributor

@arteam arteam commented Mar 15, 2022

See #83784

@arteam arteam added >non-issue >refactoring :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. labels Mar 15, 2022
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Mar 15, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer we clean up this class's task/executor as part of this change, bring it more in line with how we think these things should be implemented. That's really the purpose of the LegacyClusterTaskResultActionListener marker.

E.g. the task itself should mostly just be data (typically a record, and definitely not a subclass of AckedClusterStateUpdateTask) and the execution logic moved to the executor.

Ideally we'd not build a new cluster state each time round the loop too, although I tried that with this task and it seemed pretty tricky because of how we update the Metadata.Builder before we've finished doing all the validation steps. I can live without that change here, but we should definitely do more cleanup than just this one thing.

arteam and others added 2 commits March 15, 2022 15:35
…taUpdateSettingsService.java

Co-authored-by: David Turner <[email protected]>
…a/MetadataUpdateSettingsService.java"

This reverts commit f8709a0.
@arteam
Copy link
Contributor Author

arteam commented Mar 15, 2022

@elasticmachine update branch

@arteam arteam force-pushed the remove-lcrta-from-metadata-update-setting-service branch from 2b2205e to 9152a80 Compare March 16, 2022 10:05
@arteam
Copy link
Contributor Author

arteam commented Mar 16, 2022

@elasticmachine run elasticsearch-ci/bwc

@arteam
Copy link
Contributor Author

arteam commented Mar 16, 2022

@elasticmachine update branch

@arteam arteam requested a review from DaveCTurner March 16, 2022 14:23
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

I now realise that we didn't add tests when we made this API implement batching. I expect any problems would trip something somewhere but it would be good to have a test suite that focusses on this. See MetadataIndexStateServiceBatchingTests for some ideas about how to write this kind of test.

}

public void updateSettings(final UpdateSettingsClusterStateUpdateRequest request, final ActionListener<AcknowledgedResponse> listener) {
ActionListener<AcknowledgedResponse> actionListener = wrapPreservingContext(listener, threadPool.getThreadContext());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think this wrapping is very old and hasn't been necessary for ages. Could you add an ESSingleNodeTestCase test which sets up a thread context, calls the update settings API, and asserts that the context is passed through to the listener (even without this wrapping). See e.g. how MasterServiceTests#testTaskFailureNotification interacts with the thread context.

@arteam
Copy link
Contributor Author

arteam commented Mar 16, 2022

Sure, let me add a test!

arteam and others added 2 commits March 16, 2022 16:21
…taUpdateSettingsService.java

Co-authored-by: David Turner <[email protected]>
…taUpdateSettingsService.java

Co-authored-by: David Turner <[email protected]>
@arteam arteam closed this May 16, 2022
@arteam arteam deleted the remove-lcrta-from-metadata-update-setting-service branch May 16, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. >non-issue >refactoring Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants