Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/99892.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 99892
summary: Support $ and / in restore rename replacements
area: Snapshot/Restore
type: bug
issues:
- 99078
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,13 @@ public void testFollowNonExistentIndex() throws Exception {
);
}

public void testFollowWith$InIndexName() throws Exception {
String indexSettings = getIndexSettings(1, 0);
assertAcked(leaderClient().admin().indices().prepareCreate("test-leader$").setSource(indexSettings, XContentType.JSON).get());
followerClient().execute(PutFollowAction.INSTANCE, putFollow("test-leader$", "test-follower$")).actionGet();
ensureFollowerGreen("test-follower$");
}

public void testFollowIndexMaxOperationSizeInBytes() throws Exception {
final String leaderIndexSettings = getIndexSettings(1, between(0, 1));
assertAcked(leaderClient().admin().indices().prepareCreate("index1").setSource(leaderIndexSettings, XContentType.JSON));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import java.util.Objects;
import java.util.concurrent.Executor;
import java.util.function.BiConsumer;
import java.util.regex.Matcher;
import java.util.stream.Collectors;

import static org.elasticsearch.cluster.metadata.DataStream.BACKING_INDEX_PREFIX;
Expand Down Expand Up @@ -185,7 +186,7 @@ private void createFollowerIndex(
)
.indicesOptions(request.indicesOptions())
.renamePattern("^(.*)$")
.renameReplacement(request.getFollowerIndex())
.renameReplacement(Matcher.quoteReplacement(request.getFollowerIndex()))
.masterNodeTimeout(request.masterNodeTimeout())
.indexSettings(overrideSettings)
.quiet(true);
Expand Down