Skip to content

Confirm omitted namespaces before evicting registry entries - #12012

Draft
taylan-oai wants to merge 1 commit into
temporalio:mainfrom
taylan-oai:dev/taylan/validate-namespace-pagination
Draft

taylan-oai wants to merge 1 commit into
temporalio:mainfrom
taylan-oai:dev/taylan/validate-namespace-pagination

Conversation

@taylan-oai

Copy link
Copy Markdown

Summary

Verify cached namespaces omitted from a refresh by ID before evicting them, preventing a concurrent rename from being reported as physical deletion.

Problem

Cassandra lists namespaces in name order, with separate reads for each page. A rename from beyond the current cursor to before it can leave a live namespace out of the completed scan. The registry currently removes that cached ID and invokes deletion callbacks.

Approach

Look up each omitted cached ID before reconciling the refresh. A namespace that still exists goes through the existing name, state, and callback reconciliation. NamespaceNotFound confirms physical deletion. Other lookup or conversion errors abort the refresh before swapping the cache or delivering callbacks. When reconciling a rename, remove its old-name mapping only if that mapping still belongs to the same namespace; a newly created namespace can already have reused the name.

Validation

  • Native changed-code lint passed.
  • Reproduced the false deletion callback against Cassandra 5.0.9 using a real metadata-manager rename between list pages; the regression passes with this change and also checks subsequent physical deletion.
  • Unit coverage checks rename, deprecated and soft-deleted states, notification version and global flag, confirmed absence, wrapped absence errors, transient errors, cancellation, conversion failures, and both cache-only name lookups when a new namespace reuses the renamed namespace's old name.
  • Full registry package passes with and without the race detector.
  • Existing Cassandra metadata suite passes; the new Cassandra regression passes three times with the race detector.

Risks, rollout, and scope

Each omitted cached ID adds one persistence read, including actual deletions. Complete scans add no reads. A failed verification delays the whole refresh until its existing retry path succeeds, preserving the prior cache and queued callbacks. This does not give paginated namespace listing a consistent snapshot or change Cassandra's rename and deletion protocols.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants