-
Notifications
You must be signed in to change notification settings - Fork 60
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
[BUG]Cross cluster replication API doesn't fail if multiple pattern is configured in same rule. #1034
Comments
Hi @chaitrahegde115, you can only have 1 autofollow pattern in a autofollow rule. curl -XPOST -k -H 'Content-Type: application/json' -u 'ccr-user:ccruser' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d '
{
"leader_alias" : "leader-cluster",
"name": "replication-log",
"pattern": "log*",
"use_roles":{
"leader_cluster_role": "cross_cluster_replication_leader_full_access",
"follower_cluster_role": "cross_cluster_replication_follower_full_access"
}
}'
curl -XPOST -k -H 'Content-Type: application/json' -u 'ccr-user:ccruser' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d '
{
"leader_alias" : "leader-cluster",
"name": "replication-test",
"pattern": "test*",
"use_roles":{
"leader_cluster_role": "cross_cluster_replication_leader_full_access",
"follower_cluster_role": "cross_cluster_replication_follower_full_access"
}
}' In the case where you put "pattern": "log*, test*", the string will be considered as a single autofollow pattern, since there is space " " in the pattern and Opensearch index name cannot have " ", the replication rule will not match any index. |
Hi, |
Hi, Request feedback from maintainers on whether the requested change is valid/desirable from the plugin's design, and if yes, I would like to contribute for this. |
Hi , Since there is no validation done to check if the pattern configured intthe autofollow API is a valid indexpattern, I would like to raise a PR to add validations to check if it's a valid indexpattern thats configured in the autofollow pattern by checking for these invalid characters [ "\" , "/" , "?" , '"' , "<", ">", "|", " ", "," , "#" , ":" ]. Request feedback from maintainers on whether the changes are valid. |
What is the bug?
Cross cluster replication API doesn't fail if multiple pattern is configured in same rule.
How can one reproduce the bug?
I am using Opensearch 2.7.0 version. I created a new replication rule which contains multiple patterns to be replicated like below. But curl API doesn't throw any error and it doesn't replicate any data from leader to follower.
Steps:
What is the expected behavior?
Atleast curl command should fail if multiple index pattern replication can't be configured and not supported.
What is your host/environment?
The text was updated successfully, but these errors were encountered: