-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TemplateUpgradeService runs updates under existing ThreadContext #30603
Copy link
Copy link
Closed
Labels
:Core/Infra/PluginsPlugin API and infrastructurePlugin API and infrastructure:Distributed/Cluster CoordinationCluster formation and cluster state publication, including cluster membership and fault detection.Cluster formation and cluster state publication, including cluster membership and fault detection.:Security/AuthenticationLogging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)
Description
The TemplateUpgradeService has a high level flow of:
- receive
ClusterChangedEvent - check preconditions (global block, master node, etc)
- gather necessary updates from registered upgraders (plugins)
- apply template updates on the generic thread pool.
However
- the
ClusterChangedEventcomes in with the sameThreadContextas the action that triggered the event (which might be a node join/leave, but it also might be a settings change or index create/delete over REST). - The generic threadpool
executepreserves theThreadContextfrom the calling code.
Consequently, the template update runs with a ThreadContext that matches the original triggering action.
If X-Pack Security is enabled, that means that update which should run as _system might attempt to run as the user which authenticated to the Rest API. That user may not have privileges to perform that update.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Core/Infra/PluginsPlugin API and infrastructurePlugin API and infrastructure:Distributed/Cluster CoordinationCluster formation and cluster state publication, including cluster membership and fault detection.Cluster formation and cluster state publication, including cluster membership and fault detection.:Security/AuthenticationLogging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)
Type
Fields
Give feedbackNo fields configured for issues without a type.