Skip to content

Run TransportGetAliasesAction on local node#101815

Merged
elasticsearchmachine merged 4 commits intoelastic:mainfrom
DaveCTurner:2023/11/06/TransportGetAliasesAction-always-local
Nov 6, 2023
Merged

Run TransportGetAliasesAction on local node#101815
elasticsearchmachine merged 4 commits intoelastic:mainfrom
DaveCTurner:2023/11/06/TransportGetAliasesAction-always-local

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

@DaveCTurner DaveCTurner commented Nov 6, 2023

This action is a pure function of the cluster state, it can run on any
node. Moreover it can be fairly expensive if there are a lot of aliases
so running it on the master can be quite harmful to the cluster.
Finally, it needs to be cancellable to avoid doing unnecessary work
after a client failure or timeout.

Relates #101805

This action is a pure function of the cluster state, it can run on any
node. Moreover it can be fairly expensive if there are a lot of aliases
so running it on the master can be quite harmful to the cluster.
Finally, it needs to be cancellable to avoid doing unnecessary work
after a client failure or timeout.
@DaveCTurner DaveCTurner added >enhancement :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. v8.12.0 labels Nov 6, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Nov 6, 2023
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @DaveCTurner, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@Override
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) {
return new CancellableTask(id, type, action, "", parentTaskId, headers);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This (overriding createTask to return CancellableTask) seems to be repeating a lot around the code base.
Is it possible to do it in a common base class? Possibly something like:

default Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) {
    return this instance of CancellableRequest ? 
        new CancellableTask(id, type, action, getDescription(), parentTaskId, headers);
        new Task(id, type, action, getDescription(), parentTaskId, headers);
}

where CancellableRequest would be a new marker interface?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Eh maybe, it's kinda tricky when everything already derives from ActionRequest tho. I expect #100111 will make this simpler. Not in scope here tho.

* NB prior to 8.12 this was a TransportMasterNodeReadAction so for BwC it must be registered with the TransportService (i.e. a
* HandledTransportAction) until we no longer need to support {@link org.elasticsearch.TransportVersions#CLUSTER_FEATURES_ADDED} and
* earlier.
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems this is going to be true for all actions from the list in the task.
Is it worth to mention it once in TransportLocalClusterStateAction and ideally have a constant that would let us know when to remove HandledTransportAction base from there?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I doubt we'll get all of them done by the time v9 is released, so I'd rather keep it a case-by-case thing.

@DaveCTurner DaveCTurner added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Nov 6, 2023
@elasticsearchmachine elasticsearchmachine merged commit 676e28e into elastic:main Nov 6, 2023
@DaveCTurner DaveCTurner deleted the 2023/11/06/TransportGetAliasesAction-always-local branch November 6, 2023 10:46
elasticmachine pushed a commit to gmarouli/elasticsearch that referenced this pull request Nov 20, 2023
In elastic#101815 we made some changes to the get-aliases API that need
followup actions when preparing to release v9. At the time they were
marked with a transport version that will become obsolete in v9, but
with elastic#101767 we now have a better mechanism for leaving a reminder for
this kind of action. This commit updates things to use the new
@UpdateForV9 annotation instead.
@DaveCTurner DaveCTurner restored the 2023/11/06/TransportGetAliasesAction-always-local branch June 17, 2024 06:16
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jun 17, 2024
In elastic#101815 we made some changes to the get-aliases API that need
followup actions when preparing to release v9. At the time they were
marked with a transport version that will become obsolete in v9, but
with elastic#101767 we now have a better mechanism for leaving a reminder for
this kind of action. This commit updates things to use the new
@UpdateForV9 annotation instead.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Sep 12, 2024
Dropping support for pre-8.12 requests from remote nodes, and also
cleaning up some unnecessary abstraction in the request builder
hierarchy.

Relates elastic#101815
Relates elastic#107984 (drops some unnecessary trappy timeouts)
DaveCTurner added a commit that referenced this pull request Sep 16, 2024
Dropping support for pre-8.12 requests from remote nodes, and also
cleaning up some unnecessary abstraction in the request builder
hierarchy.

Relates #101815
Relates #107984 (drops some unnecessary trappy timeouts)
PeteGillinElastic added a commit to PeteGillinElastic/elasticsearch that referenced this pull request Oct 23, 2024
This removes the `local` attribute from the `GET /_alias`, `HEAD
/_alias`, and `GET /_cat/aliases` APIs. This option became a no-op and
was deprecated in 8.12 by
elastic#101815.

update rest spec and tests for cat.aliases

rest spec and tests for get/head alias
PeteGillinElastic added a commit to PeteGillinElastic/elasticsearch that referenced this pull request Oct 23, 2024
This removes the `local` attribute from the `GET /_alias`, `HEAD
/_alias`, and `GET /_cat/aliases` APIs. This option became a no-op and
was deprecated in 8.12 by
elastic#101815.
PeteGillinElastic added a commit to PeteGillinElastic/elasticsearch that referenced this pull request Oct 23, 2024
This removes the `local` attribute from the `GET /_alias`, `HEAD
/_alias`, and `GET /_cat/aliases` APIs. This option became a no-op and
was deprecated in 8.12 by
elastic#101815.
PeteGillinElastic added a commit that referenced this pull request Oct 24, 2024
This removes the `local` parameter from the `GET /_alias`, `HEAD /_alias`, and `GET /_cat/aliases` APIs. This option became a no-op and was deprecated in 8.12 by #101815.

We continue to accept the parameter (deprecated, with no other effect) in v8 compatibility mode for `GET /_alias` and `HEAD /_alias`. We don't do this for `GET /_cat/aliases` where the [compatibility policy does not apply](https://github.com/elastic/elasticsearch/blob/main/REST_API_COMPATIBILITY.md#when-not-to-apply).
georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Oct 25, 2024
This removes the `local` parameter from the `GET /_alias`, `HEAD /_alias`, and `GET /_cat/aliases` APIs. This option became a no-op and was deprecated in 8.12 by elastic#101815.

We continue to accept the parameter (deprecated, with no other effect) in v8 compatibility mode for `GET /_alias` and `HEAD /_alias`. We don't do this for `GET /_cat/aliases` where the [compatibility policy does not apply](https://github.com/elastic/elasticsearch/blob/main/REST_API_COMPATIBILITY.md#when-not-to-apply).
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Nov 4, 2024
This removes the `local` parameter from the `GET /_alias`, `HEAD /_alias`, and `GET /_cat/aliases` APIs. This option became a no-op and was deprecated in 8.12 by elastic#101815.

We continue to accept the parameter (deprecated, with no other effect) in v8 compatibility mode for `GET /_alias` and `HEAD /_alias`. We don't do this for `GET /_cat/aliases` where the [compatibility policy does not apply](https://github.com/elastic/elasticsearch/blob/main/REST_API_COMPATIBILITY.md#when-not-to-apply).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. >enhancement Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v8.12.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants