Replication rule is present even after successfully deleting it

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Opensearch version 2.2.1
Plugin: opensearch-cross-cluster-replication v2.2.1.0

Describe the issue:
I have deleted a replication rule by “/_plugins/_replication/_autofollow” api. However still when I run “/_plugins/_replication/autofollow_stats” api ,I could still see the deleted rule in the output.

Configuration:
Deleted rule using below command:
curl -XDELETE -k -H ‘Content-Type: application/json’ -u ‘username:password’ ‘https://IP:9200/_plugins/_replication/_autofollow?pretty’ -d ’
{
“leader_alias” : “my-conection-new”,
“name”: “my-replication-rule-1”
}’

Relevant Logs or Screenshots:
Running autofollow_stats output still give replication rule in the output.

curl -XGET -u ‘username:password’ -k ‘https://IP:9200/_plugins/_replication/autofollow_stats
{
“num_success_start_replication” : 4,
“num_failed_start_replication” : 0,
“num_failed_leader_calls” : 0,
“failed_indices” : ,
“autofollow_stats” : [
{
“name” : “my-replication-rule-1”,
“pattern” : “movies*”,
“num_success_start_replication” : 4,
“num_failed_start_replication” : 0,
“num_failed_leader_calls” : 0,
“failed_indices” : ,
“last_execution_time” : 1668518389940
}
]
}

Is this a known bug or expected behaviour? Why is replication rule visible even after its deletion?

This indeed looks to be a bug. I’ll attempt a repro and file a github issue.