Skip to content

Add RPC definitions for namespace soft deletion and restoration - #899

Open
awln-temporal wants to merge 2 commits into
mainfrom
awln/namespace-soft-delete
Open

awln-temporal wants to merge 2 commits into
mainfrom
awln/namespace-soft-delete

Conversation

@awln-temporal

Copy link
Copy Markdown
Contributor

What changed?
Add RPC definitions for namespace soft deletion and restoration.

Why?
Add new feature for namespace soft deletion. Supports two operations: marking a namespace as soft deleted, and restoring the namespace back to REGISTERED state.

When a namespace is in soft deleted state, existing tasks will get dropped, and any inbound API calls and outbound task dispatching will be invalidated, so no executions can progress.

To recover a namespace back to REGISTERED state and allow executions to update, an Operator API RestoreNamespace will be added that will mark the namespace state as REGISTERED, then start a system workflow to conduct a batch refresh of tasks for all executions in the namespace, across all replicated clusters listed in the NamespaceReplicationConfig.

This is the PR required to unblock server feature development.

Breaking changes
N/A

Server PR
N/A

@awln-temporal
awln-temporal requested review from a team, yuandrew and yycptt October 27, 2026 20:46

message SoftDeleteNamespaceRequest {
// Only one of namespace or namespace_id must be specified to identify namespace.
string namespace = 1;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @yycptt should we still include this as an option?

@awln-temporal
awln-temporal force-pushed the awln/namespace-soft-delete branch from c21097c to e0de7a7 Compare October 28, 2026 15:10
message RestoreNamespaceResponse {
}

message DescribeNamespaceRestoreRequest {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option here is RestoreNamespaceRequest returning a job token(maybe the runID of restore workflow) and DescribeNamespaceRestoreRequest passing that job token. That will help us query the status of multiple past operations. But maybe that is not very important since we only have on Restore operation per namespace at a time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I figured most of the time you wouldn't care about previous restore workflows. If you think this would be useful we can include this in another change.

int64 total_execution_count = 6;
// Executions processed on every cluster.
int64 processed_execution_count = 7;
google.protobuf.Timestamp estimated_completion_time = 8;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if server should calculate this. Can the client calculate this based on start_time, current_time and the progress?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it can, I just included it so client wouldn't need to do this, and I suppose mostly irrelevant but it'd be calculated based off the clock of the server.

If it's something that might be useful to OSS users I figured might as well just have server provide this.

@awln-temporal
awln-temporal enabled auto-merge (squash) October 30, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants