Skip to content

Commit 2fa563f

Browse files
committed
Docs: site doc CREATE POLICY section reflects idempotency contract
Match the provider README paragraph added with the dispatcher change. Site doc kept ASCII-only per site-build constraint.
1 parent 14d14d7 commit 2fa563f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

docs/site/opensearch.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ Uploads the policy to `_plugins/_ism/policies` (or `_opendistro/_ism/policies` o
503503
}
504504
```
505505

506+
`CREATE POLICY` is **idempotent**. ISM versions policies internally, so a plain `PUT` to an already-existing policy returns HTTP 409 `version_conflict_engine_exception`. The dispatcher transparently handles this: on 409 it reads the current `_seq_no` and `_primary_term` from the existing policy and retries the `PUT` with `if_seq_no` / `if_primary_term` query parameters. The result is upsert semantics -- no behavior change when the policy doesn't exist; safe re-execution when it does. This makes `CREATE POLICY` usable inside `[Migration(N, journal: false)]` reconciliation migrations that re-run on every startup. A second 409 on the retry indicates a concurrent writer between the GET and the retry PUT and is surfaced as a hard failure (the migration lock should make this rare).
507+
506508
### APPLY POLICY (ISM)
507509

508510
```

0 commit comments

Comments
 (0)