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

Support $ and / in ccr follow #99892

Merged
merged 8 commits into from
Oct 4, 2023
Merged

Conversation

Tim-Brooks
Copy link
Contributor

@Tim-Brooks Tim-Brooks commented Sep 26, 2023

Currently the renameReplacement variable in the restore snapshot request
is intended to be a string literal for ccr. However, when a string is passed
to replaceAll in java $ and / will be treated as special characters. This
means that following indices with $ in them breaks. This commit fixes the
issue by quoting the special characters before calling replaceAll.

Fixes #99078.

Currently the renameReplacement variable in the restore snapshot request
is intended to be a string literal. However, when a string is passed to
replaceAll in java $ and / will be treated as special characters. This
means that restoring indices with $ in them occasionally breaks. This
commit fixes the issue by quoting the special characters before calling
replaceAll.

Fixes elastic#99078.
@Tim-Brooks Tim-Brooks added >bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.11.0 v8.10.1 labels Sep 26, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Sep 26, 2023
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @Tim-Brooks, I've created a changelog YAML for you.

@Tim-Brooks Tim-Brooks changed the title Support $ and / in restore rename replacements Support $ and / in ccr follow Oct 3, 2023
@repantis repantis added v8.10.3 and removed v8.10.1 labels Oct 3, 2023
@arteam arteam self-requested a review October 4, 2023 07:43
Copy link
Contributor

@idegtiarenko idegtiarenko left a comment

Choose a reason for hiding this comment

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

I think the test failure is unrelated to the change. 👍

@arteam
Copy link
Contributor

arteam commented Oct 4, 2023

I believe the failed test has already been muted in #100192

Copy link
Contributor

@arteam arteam left a comment

Choose a reason for hiding this comment

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

LGTM2

@mattc58 mattc58 added v8.12.0 and removed v8.11.0 labels Oct 4, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@repantis repantis added v8.11.0 and removed v8.12.0 labels Oct 4, 2023
@Tim-Brooks Tim-Brooks merged commit 7a9aadb into elastic:main Oct 4, 2023
Tim-Brooks added a commit to Tim-Brooks/elasticsearch that referenced this pull request Oct 4, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Currently the renameReplacement variable in the restore snapshot request
is intended to be a string literal for ccr. However, when a string is passed
to replaceAll in java $ and / will be treated as special characters. This
means that following indices with $ in them breaks. This commit fixes the
issue by quoting the special characters before calling replaceAll.

Fixes elastic#99078.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.11
8.10

Tim-Brooks added a commit to Tim-Brooks/elasticsearch that referenced this pull request Oct 4, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Currently the renameReplacement variable in the restore snapshot request
is intended to be a string literal for ccr. However, when a string is passed
to replaceAll in java $ and / will be treated as special characters. This
means that following indices with $ in them breaks. This commit fixes the
issue by quoting the special characters before calling replaceAll.

Fixes elastic#99078.
elasticsearchmachine pushed a commit that referenced this pull request Oct 4, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Currently the renameReplacement variable in the restore snapshot request
is intended to be a string literal for ccr. However, when a string is passed
to replaceAll in java $ and / will be treated as special characters. This
means that following indices with $ in them breaks. This commit fixes the
issue by quoting the special characters before calling replaceAll.

Fixes #99078.
elasticsearchmachine pushed a commit that referenced this pull request Oct 4, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Currently the renameReplacement variable in the restore snapshot request
is intended to be a string literal for ccr. However, when a string is passed
to replaceAll in java $ and / will be treated as special characters. This
means that following indices with $ in them breaks. This commit fixes the
issue by quoting the special characters before calling replaceAll.

Fixes #99078.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.10.3 v8.11.0 v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It is impossible to create a follower index with $ character in its name
6 participants