Skip to content

Invoke GetRollupCapsAction in a management thread#98314

Merged
csoulios merged 9 commits intoelastic:mainfrom
csoulios:rollup-threads
Aug 9, 2023
Merged

Invoke GetRollupCapsAction in a management thread#98314
csoulios merged 9 commits intoelastic:mainfrom
csoulios:rollup-threads

Conversation

@csoulios
Copy link
Copy Markdown
Contributor

@csoulios csoulios commented Aug 9, 2023

As discussed in #92179, RestGetRollupCapsAction and RestGetRollupIndexCapsAction invoke expensive GetRollupCapsAction on transport threads.

This PR modifies the rest actions so that they invoke GetRollupCapsAction in a separate thread

Fixes #92179
Relates to #97916

@csoulios csoulios added >non-issue :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data labels Aug 9, 2023
@csoulios csoulios requested a review from DaveCTurner August 9, 2023 11:03
@csoulios csoulios changed the title Execute GetRollupCapsAction in a management thread Invoke GetRollupCapsAction in a management thread Aug 9, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Aug 9, 2023
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

Copy link
Copy Markdown
Member

@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.

LGTM thanks @csoulios. Nit: would you revert the whitespace changes?

) {
super(GetRollupCapsAction.NAME, transportService, actionFilters, GetRollupCapsAction.Request::new, ThreadPool.Names.MANAGEMENT);
this.clusterService = clusterService;
this.threadPool = threadPool;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I don't think we need to capture this, it's not used AFAICT. Also it's available already as transportService.getThreadPool(), no need to add a constructor arg.

ThreadPool.Names.MANAGEMENT
);
this.clusterService = clusterService;
this.threadPool = threadPool;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: likewise here, I don't think we need to capture this, it's not used AFAICT. Also it's available already as transportService.getThreadPool(), no need to add a constructor arg.

ThreadPool threadPool,
ActionFilters actionFilters
) {
super(GetRollupCapsAction.NAME, transportService, actionFilters, GetRollupCapsAction.Request::new, ThreadPool.Names.MANAGEMENT);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@DaveCTurner should I use ThreadPool.Names.SAME here, like we do in

super(actionName, canTripCircuitBreaker, transportService, actionFilters, request, ThreadPool.Names.SAME);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In practice it doesn't matter in this case because this action is only ever executed from REST actions, which ignore this parameter, but yes it'd be good to follow the same pattern anyway. Please also include the comment about #97916.

Copy link
Copy Markdown
Member

@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.

LGTM still (even better than before)

@csoulios csoulios merged commit cf03a65 into elastic:main Aug 9, 2023
@csoulios csoulios deleted the rollup-threads branch August 9, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.10.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RestGetRollupCapsAction and RestGetRollupIndexCapsAction invoke expensive GetRollupCapsAction on transport threads

3 participants