Repository navigation
Reject datastore table teardown while a URI-bound label references it - #477
Merged
Merged
Conversation
This was referenced Aug 6, 2026
em3s
force-pushed
the
fix/guard-datastore-table-references
branch
3 times, most recently
from
August 6, 2026 08:56
d264d3b to
0fbae0f
Compare
Disabling or dropping an HBase table checked only for a `StorageEntity` naming it. A label can
instead bind straight to the table with a `datastore://{namespace}/{table}` URI and no storage
entity at all, and every table created through the v3 API takes that form —
`TableCreateRequest.storage` is validated against `Constants.Name.STORAGE_URI_PATTERN`. The scan
found nothing for those, so a table serving live reads and writes could be disabled or dropped.
`DatastoreTableReferences` resolves both binding forms against the metadata graph, completing the
`alias -> label -> storage -> table` chain whose upper hops `LabelDdlService.canDeactivate` and
`StorageDdlService.canDeactivate` already guard. It also handles `datastore:///{table}`, which
omits the namespace and resolves to the cluster's configured one.
Both HBase admin surfaces now use it, replacing three copies of the inline storage scan. The v2
copies also dereferenced `conf.get("namespace")` without a null check.
This rejects teardown that used to succeed. A table bound by an active label must now be
deactivated first, which is the order the rest of the chain already enforces.
`/graph/v2/admin/hbase` stays cluster-blind: it matches against this server's metadata whatever
`cluster` the caller names, as it always has. For a remote cluster that errs toward refusing.
em3s
force-pushed
the
fix/guard-datastore-table-references
branch
from
August 6, 2026 09:05
0fbae0f to
4fae82e
Compare
Contributor
Author
|
Optimistic |
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Disabling or dropping an HBase table only checked for a
StorageEntitynaming it. A label can bind straight to the table with adatastore://{namespace}/{table}URI and no storage entity at all, and every table the v3 API creates takes that form. So a table serving live reads and writes could be disabled or dropped.Relates to #370
Changes
DatastoreTableReferences, resolving both binding formsDatastoreHBaseServiceandHBaseController, replacing three copies of the inline storage scanmetadataFetchLimit— a truncated page can't prove a table is unreferencedMono.deferso the guard runs first. An argument tothenis evaluated eagerly, which put connection setup ahead of the checkHow to Test
Behavior change
Teardown that used to succeed is now rejected — a table bound by an active label has to be deactivated first.
/graph/v2/admin/hbasestays cluster-blind as before, so for a remote cluster it errs toward refusing.AI Assistance