-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Drop project-id from threadcontext for CCS #136675
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
Drop project-id from threadcontext for CCS #136675
Conversation
When making a request to a remote cluster, we don't want to include
the current project-id ("X-Elastic-Project-Id") header in the thread
context that we send to the remote cluster because the current
project-id is not relevant to the thread context for the remote
execution.
Backport of: elastic#136664
| final Set<String> allRequestHeadersToCopy = new HashSet<>(HEADERS_TO_COPY); | ||
| if (headersFor == HeadersFor.REMOTE_CLUSTER) { | ||
| // Don't send the current project id to a remote cluster/project | ||
| allRequestHeadersToCopy.remove(Task.X_ELASTIC_PROJECT_ID_HTTP_HEADER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just highlighting that if Task.X_ELASTIC_PROJECT_ID_HTTP_HEADER is in requestHeaders it will still keep coming. If that's okay, then it is fine, otherwise it's worth moving this logic below the addAll,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's intentional. If you explicitly specify to preserve it in requestHeaders, then it will not be removed.
See comment here.
This comment was marked as outdated.
This comment was marked as outdated.
When making a request to a remote cluster, we don't want to include
the current project-id ("X-Elastic-Project-Id") header in the thread
context that we send to the remote cluster because the current
project-id is not relevant to the thread context for the remote
execution.
Backport of: elastic#136664,elastic#136675
When making a request to a remote cluster, we don't want to include
the current project-id ("X-Elastic-Project-Id") header in the thread
context that we send to the remote cluster because the current
project-id is not relevant to the thread context for the remote
execution.
Backport of: #136664,#136675
When making a request to a remote cluster, we don't want to include the current project-id ("X-Elastic-Project-Id") header in the thread context that we send to the remote cluster because the current project-id is not relevant to the thread context for the remote execution.
Backport of: #136664