Bug
When a namespace is dropped, topics that belong to that namespace are currently not dropped as well.
Expected behavior
Dropping a namespace should also remove all topics owned by that namespace.
Example expectation:
CREATE NAMESPACE app;
CREATE TOPIC app.user_events;
DROP NAMESPACE app;
After DROP NAMESPACE app, app.user_events should no longer exist and should not be visible/listable/usable.
Current behavior
The namespace is dropped, but its topics remain behind.
Why this matters
Leaving namespace-owned topics behind can create orphaned metadata/state and confusing behavior later, for example:
- listing topics may show topics for a namespace that no longer exists
- recreating the namespace may collide with old topic names
- consumers/sources may still point to deleted namespace-owned resources
- storage/manifest cleanup may be incomplete
Suggested fix
When handling DROP NAMESPACE, cascade cleanup should include all namespace-scoped topics.
Implementation should likely cover:
- metadata removal for topics under the namespace
- topic storage cleanup if applicable
- topic sources/consumers cleanup if they are namespace-scoped
- tests verifying
DROP NAMESPACE removes related topics
Test case to add
- Create a namespace.
- Create one or more topics under it.
- Drop the namespace.
- Assert the topics no longer exist.
- Assert recreating the namespace/topic does not hit stale metadata from the previous topic.
Note
This should behave similarly to dropping a schema/namespace with owned child objects: namespace-owned topics should not survive after their parent namespace is removed.
Bug
When a namespace is dropped, topics that belong to that namespace are currently not dropped as well.
Expected behavior
Dropping a namespace should also remove all topics owned by that namespace.
Example expectation:
After
DROP NAMESPACE app,app.user_eventsshould no longer exist and should not be visible/listable/usable.Current behavior
The namespace is dropped, but its topics remain behind.
Why this matters
Leaving namespace-owned topics behind can create orphaned metadata/state and confusing behavior later, for example:
Suggested fix
When handling
DROP NAMESPACE, cascade cleanup should include all namespace-scoped topics.Implementation should likely cover:
DROP NAMESPACEremoves related topicsTest case to add
Note
This should behave similarly to dropping a schema/namespace with owned child objects: namespace-owned topics should not survive after their parent namespace is removed.