temporal
temporal copied to clipboard
Deleted Namespace is still listed with state Registered
Actual Behavior
If a namespace is created, deleted, created and again deleted, then there is sometimes the behavior, that temporal cli reports:
Error: unable to delete namespace: Namespace has invalid state: Deleted. Must be Registered or Deprecated.
But an invocation of list command will return that the namespace is registered:
NamespaceInfo.Name test0815
NamespaceInfo.State Registered
Expected Behavior
Namespace state should be "Deleted" OR Namespace should be removed after a delete call
Steps to Reproduce the Problem
start this file with docker-compose
version: "3.8"
services:
temporal:
image: temporalio/auto-setup:1.22.3.0
container_name: temporal-for-tests
environment:
- DB=postgres12
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_SEEDS=postgresql
ports:
- 7233:7233
depends_on:
- postgresql
postgresql:
image: postgres:13
environment:
POSTGRES_PASSWORD: temporal
POSTGRES_USER: temporal
ports:
- 5432:5432
volumes:
- /var/lib/postgresql/data
I wrote a little bash script to reproduce the problem. It consistently reproduces the issue for me. Please let me know if this is not the case for you:
while true; do sleep 1;temporal operator namespace create test0815; temporal operator namespace delete -y test0815; temporal operator namespace list; echo "###########################"; done