Skip to content

Assign new IDs to recreated topics - #434

Open
novatechflow wants to merge 1 commit into
KafScale:mainfrom
novatechflow:fix/424-topic-incarnation-ids
Open

novatechflow wants to merge 1 commit into
KafScale:mainfrom
novatechflow:fix/424-topic-incarnation-ids

Conversation

@novatechflow

Copy link
Copy Markdown
Collaborator

Summary

A deleted and recreated topic currently reuses its name-derived topic ID, so clients cannot distinguish its old incarnation from the new one. New API and operator topic creations now allocate random v4 UUIDs and persist them with the metadata snapshot.

Snapshot publication keeps the committed ID across reconciliation, partition expansion and concurrent writers. An optional resource-UID map in the same snapshot distinguishes Kubernetes resource incarnations, survives broker mutations and is cleared on topic deletion. Existing stored IDs remain unchanged, including the legacy name-derived fallback for snapshots without an explicit ID.

Kafka Fetch and Metadata requests carrying a deleted topic's old ID now resolve to UNKNOWN_TOPIC_ID. The real librdkafka test obtains topic IDs from Metadata rather than deriving them. Protocol documentation and release notes describe persistence and upgrade behavior.

Closes #424.

Testing

  • New topic-ID lifecycle, concurrent API creation, concurrent operator publication, legacy upgrade and stale wire-ID regressions: 10 repetitions with -race.
  • Full metadata and operator packages: go test ./pkg/metadata ./pkg/operator.
  • Real librdkafka broker/proxy compatibility and operator snapshot consumption: KAFSCALE_E2E=1 go test -race -tags=e2e ./test/e2e -run '^(TestLibrdkafkaCompatibilityE2E|TestSnapshotPublishAndBrokerConsumption)$' -count=1 -timeout=3m.
  • go vet -tags=e2e ./pkg/metadata ./pkg/operator ./cmd/broker ./test/e2e.
  • Formatting, license headers and patch whitespace.
  • make commit-check is running. Local CodeQL 2.27.2 has a known incompatibility with the latest query-model format; the final outcome will be recorded here.

Checklist

  • Added lifecycle, restart, expansion, recreation, concurrency, reconciliation and upgrade regressions.
  • Updated real-client coverage to discover persisted topic IDs.
  • Added license headers to new files.

This branch has not been deployed

No deployments
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.

Topic ID should change when a topic is deleted and recreated

1 participant