Repository navigation
Allow changing a namespace's archival URI (e.g. to move archival to a new bucket) #12821
michal-billtech
started this conversation in
Temporal Backend
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Once a namespace's history/visibility archival URI is set, it can never be changed. Disabling archival first does not help:
UpdateNamespacerejects any URI change withCannot update existing archival URI(common/namespace/archival_config_state_machine.go, thestateURISet && eventURISet && s.URI != e.URIcheck, unchanged onmain/ v1.32.1).That makes it impossible to move archival to another bucket on a live namespace. Real cases:
The only alternatives today are keeping the old bucket forever for archival, or deleting/re-creating the namespace (new namespace ID, all executions and schedules lost).
What we found while evaluating this (v1.29.1)
The rule comes from Cadence (Enable archival config per domain cadence-workflow/cadence#1351, Dec 2018: "Once archival is enabled a bucket name is always set and can never be changed"). We could not find a stated rationale beyond that.
The URI is not persisted per execution or per archival task. The archival queue task executor resolves it from the namespace entry at execution time (
service/history/archival_queue_task_executor.go), and reads (getArchivedHistory,ListArchivedWorkflowExecutions) also use only the namespace's current URI (service/frontend/workflow_handler.go).So the guard seems to protect against one thing: after a change, data archived under the old URI is no longer reachable unless it is copied under the same keys to the new location.
In a local test with Cassandra, editing
config.history_archival_uri/visibility_archival_uriin the namespace'sNamespaceDetailblob directly in persistence worked:It works, but it is unsupported and risky: a bad blob breaks namespace loading cluster-wide, and it races with concurrent
UpdateNamespacecalls.Describe the solution you'd like
A supported way to change the archival URI, for example:
UpdateNamespace/temporal operator namespace updatebehind an explicit opt-in (e.g. a--force-archival-uri-changeflag, possibly only while archival is disabled), with the new URI validated like on registration, and documentation that existing archives must be copied to the new location to stay readable; orFor global namespaces, the same opt-in would need to replicate consistently.
Additional context
Server 1.29.1, s3store provider (S3-compatible,
s3ForcePathStyle). Happy to provide more details from the test.All reactions