What was reported:
Issue temporalio/temporal#4160 (closed, 12 comments): ## Expected Behavior
The search attributes should never got lost after registering
## Actual Behavior
Sometimes it will get lost
## Steps to Reproduce the Problem
This is the script that I used to register search attributes automatically after service is up running in docker.
It happens occasionally that one of the three (randomly) will be lost after the CLI command show up the registering is succeeded.
E.g. in this integ test failure: https://github.com/indeedeng/iwf/actions/runs/4682724673/jobs/8297177058
In dump docker logs you can see:
```
You are about to add search...
What works:
Register all search attributes in a single CLI call using the Temporal CLI (not the deprecated `tctl`):
temporal search-attribute create --namespace default \
--name CustomKeywordField --type Keyword \
--name CustomIntField --type Int
Two things from the thread: the `tctl` code path was out of date relative to Temporal CLI, so switching CLIs matters; and search-attribute caches refresh about once a minute, while the `list` command reads persistence directly, so use it to verify. Known edge case: adding several same-type attributes at once could lose one; a fix PR (#4273) was proposed but not confirmed merged, so the single-call pattern above is the safe approach.