Repository navigation
Add explicit enable/disable HBase table and replication action endpoints - #320
Merged
Merged
Conversation
Add four POST action endpoints on the v3 HBase datastore controller so
operators can run the safe table-cleanup runbook explicitly:
1. set replicationScope=0 on both clusters (alter while the table is
still serving writes),
2. disable the table,
3. drop it.
Endpoints:
- POST /graph/v3/datastore/hbase/tables/{name}/enable
- POST /graph/v3/datastore/hbase/tables/{name}/disable
- POST /graph/v3/datastore/hbase/tables/{name}/replication/enable
- POST /graph/v3/datastore/hbase/tables/{name}/replication/disable
The replication toggles call AsyncAdmin.modifyColumnFamily on the
existing column family descriptor, which is an online alter and works
on actively-served tables — required because the scope flip must happen
before any disable/drop. They intentionally skip the storage-in-use
guard for the same reason. The enable/disable action endpoints keep the
guard, matching the existing updateTable behavior. All four require the
production-admin role, same as updateTable.
updateTable (PUT) is left untouched for backward compatibility.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
setReplicationScope used to modify only the first column family via modifyColumnFamily, so extras on a multi-CF table kept their old scope — leaving the cleanup runbook in an inconsistent state. Build a TableDescriptor with every stale CF updated and call modifyTable instead, so all CFs flip in one online alter. Skip the alter when every CF already matches the target scope. Add a multi-CF integration test that adds a second column family via addColumnFamily before flipping, verifying both end up at REPLICATION_SCOPE_GLOBAL. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The four new action endpoints (enable, disable, replication enable, replication disable) shared the generic "update operations" rejection message. An operator seeing the 403 could not tell which action was blocked. Tailor each message to its action.
Contributor
Author
|
Merging |
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
Add four explicit action endpoints on the HBase datastore controller for the safe table-cleanup runbook: flip
replicationScopefirst (online, while the table still serves writes), then disable, then drop. Splitting these out ofupdateTable(PUT) lets the replication flip run without the storage-in-use guard, which the runbook requires.Changes
POST .../tables/{name}/enableand.../disable— keep the storage-in-use guard, mirrorupdateTablePOST .../tables/{name}/replication/enableand.../disable— callAsyncAdmin.modifyColumnFamilyon the existing CF; skip the in-use guard; idempotent when already at target scopeupdateTable(PUT) is unchangedHBaseAdmin/HBaseTableSchema)How to Test
./gradlew :engine:test --tests "*.HBaseAdminTest"— 10/10 pass (3 new replication tests)./gradlew :server:build -x testand:server:spotlessCheck :engine:spotlessCheck— passreplication/disableagainst a real cluster while the table is enabled and serving writes; then full runbook (replication/disable → disable → delete on both clusters)AI Assistance