Repository navigation
Add scan-and-delete for immutable edge tables - #438
Merged
Merged
Conversation
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 08:55
830506b to
80f85ec
Compare
1 task done
em3s
added a commit
that referenced
this pull request
Jul 21, 2026
Make #438 self-contained: a user-facing endpoint and E2E for the engine scan-and-delete primitive, plus a bound on how much one call can delete. - EdgeMutationController: DELETE /graph/v3/databases/{db}/tables/{table}/edges/scan/{index} (start, direction, limit, ranges) -> EdgeScanDeleteResponse{database, table, index, deleted}. `limit` is required (destructive op, force explicit intent). - MutationService.scanDelete caps `limit` at MAX_SCAN_DELETE_LIMIT (1000) so one call cannot scan-and-delete an unbounded range in a single RPC batch; callers loop to drain a larger range. Enforced at the engine so every caller is bounded. - E2E in ImmutableEdgeE2ETest: append then scanDelete `seq <= X` deletes the matched page and leaves the rest; over-cap limit is rejected with 400. DELETE is blocked in read-only mode by the existing ReadOnlyRequestFilter (non-GET). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 12:57
80f85ec to
ae2cb22
Compare
em3s
added a commit
that referenced
this pull request
Jul 21, 2026
Make #438 self-contained: a user-facing endpoint and E2E for the engine scan-and-delete primitive, plus a bound on how much one call can delete. - EdgeMutationController: DELETE /graph/v3/databases/{db}/tables/{table}/edges/scan/{index} (start, direction, limit, ranges) -> EdgeScanDeleteResponse{database, table, index, deleted}. `limit` is required (destructive op, force explicit intent). - MutationService.scanDelete caps `limit` at MAX_SCAN_DELETE_LIMIT (1000) so one call cannot scan-and-delete an unbounded range in a single RPC batch; callers loop to drain a larger range. Enforced at the engine so every caller is bounded. - E2E in ImmutableEdgeE2ETest: append then scanDelete `seq <= X` deletes the matched page and leaves the rest; over-cap limit is rejected with 400. DELETE is blocked in read-only mode by the existing ReadOnlyRequestFilter (non-GET). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 13:02
ae2cb22 to
78bfc14
Compare
em3s
added a commit
that referenced
this pull request
Jul 21, 2026
Make #438 self-contained: a user-facing endpoint and E2E for the engine scan-and-delete primitive, plus a bound on how much one call can delete. - EdgeMutationController: DELETE /graph/v3/databases/{db}/tables/{table}/edges/scan/{index} (start, direction, limit, ranges) -> EdgeScanDeleteResponse{database, table, index, deleted}. `limit` is required (destructive op, force explicit intent). - MutationService.scanDelete caps `limit` at MAX_SCAN_DELETE_LIMIT (1000) so one call cannot scan-and-delete an unbounded range in a single RPC batch; callers loop to drain a larger range. Enforced at the engine so every caller is bounded. - E2E in ImmutableEdgeE2ETest: append then scanDelete `seq <= X` deletes the matched page and leaves the rest; over-cap limit is rejected with 400. DELETE is blocked in read-only mode by the existing ReadOnlyRequestFilter (non-GET). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 13:44
78bfc14 to
28c795c
Compare
em3s
added a commit
that referenced
this pull request
Jul 21, 2026
Make #438 self-contained: a user-facing endpoint and E2E for the engine scan-and-delete primitive, plus a bound on how much one call can delete. - EdgeMutationController: DELETE /graph/v3/databases/{db}/tables/{table}/edges/scan/{index} (start, direction, limit, ranges) -> EdgeScanDeleteResponse{database, table, index, deleted}. `limit` is required (destructive op, force explicit intent). - MutationService.scanDelete caps `limit` at MAX_SCAN_DELETE_LIMIT (1000) so one call cannot scan-and-delete an unbounded range in a single RPC batch; callers loop to drain a larger range. Enforced at the engine so every caller is bounded. - E2E in ImmutableEdgeE2ETest: append then scanDelete `seq <= X` deletes the matched page and leaves the rest; over-cap limit is rejected with 400. DELETE is blocked in read-only mode by the existing ReadOnlyRequestFilter (non-GET). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
2 times, most recently
from
July 21, 2026 13:58
fc9987b to
945a7ec
Compare
em3s
added a commit
that referenced
this pull request
Jul 21, 2026
Make #438 self-contained: a user-facing endpoint and E2E for the engine scan-and-delete primitive, plus a bound on how much one call can delete. - EdgeMutationController: DELETE /graph/v3/databases/{db}/tables/{table}/edges/scan/{index} (start, direction, limit, ranges) -> EdgeScanDeleteResponse{database, table, index, deleted}. `limit` is required (destructive op, force explicit intent). - MutationService.scanDelete caps `limit` at MAX_SCAN_DELETE_LIMIT (1000) so one call cannot scan-and-delete an unbounded range in a single RPC batch; callers loop to drain a larger range. Enforced at the engine so every caller is bounded. - E2E in ImmutableEdgeE2ETest: append then scanDelete `seq <= X` deletes the matched page and leaves the rest; over-cap limit is rejected with 400. DELETE is blocked in read-only mode by the existing ReadOnlyRequestFilter (non-GET). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 task done
Immutable edge tables persist only index rows, so deleting the scanned index keys is a complete delete — the building block queue retention/eviction needs. - IndexedLabelMixin.scanAndDeleteIndexedEdges: scan one page of a range and delete the matched index rows via the existing deleteIndexedEdges, returning the count deleted. - TableBinding.scanDelete + V2BackedTableBinding (gated to immutable edges) + NilTableBinding (no-op). - MutationService.scanDelete exposes it on the write path. HBase has no native range delete, so this issues per-row point deletes after a scan (bounded by limit; callers loop to trim a larger range). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- require the label is IMMUTABLE_INDEXED inside scanAndDeleteIndexedEdges, so it cannot corrupt a mutable table (deleting index rows there would leave its State row and count records dangling). - document the group-aggregate semantics: scan-and-delete is eviction, not a logical un-append, so group aggregates (lifetime append counts) are intentionally not decremented. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Make #438 self-contained: a user-facing endpoint and E2E for the engine scan-and-delete primitive, plus a bound on how much one call can delete. - EdgeMutationController: DELETE /graph/v3/databases/{db}/tables/{table}/edges/scan/{index} (start, direction, limit, ranges) -> EdgeScanDeleteResponse{database, table, index, deleted}. `limit` is required (destructive op, force explicit intent). - MutationService.scanDelete caps `limit` at MAX_SCAN_DELETE_LIMIT (1000) so one call cannot scan-and-delete an unbounded range in a single RPC batch; callers loop to drain a larger range. Enforced at the engine so every caller is bounded. - E2E in ImmutableEdgeE2ETest: append then scanDelete `seq <= X` deletes the matched page and leaves the rest; over-cap limit is rejected with 400. DELETE is blocked in read-only mode by the existing ReadOnlyRequestFilter (non-GET). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 14:48
945a7ec to
704c41b
Compare
Contributor
Author
|
Optimistic |
1 task done
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 a scan-and-delete primitive for immutable edge tables and expose it end-to-end — the building block queue/v1 uses to bound its log. Both a consumer commit (poll → process → commit, #439) and plain retention reduce to the same thing: delete a processed prefix by scanning an index range and deleting the matched rows.
An immutable edge table persists only index rows (no State row, no count), so deleting the scanned index keys is a complete delete. HBase has no native range delete, so this scans the matching index rows and issues per-row point deletes (bounded by
limit; callers loop to trim a larger range).Builds on the immutable-edge constraint from #440 (already merged to
main): one index in one direction is exactly what makes "deleting the scanned index keys is a complete delete" true by construction.Changes
Engine primitive:
IndexedLabelMixin.scanAndDeleteIndexedEdges(scanFilter)— scans one page of a range and deletes the matched index rows via the existingdeleteIndexedEdges, returning the count deleted.TableBinding.scanDelete(index, start, direction, limit, ranges)— new binding op;V2BackedTableBindingimplements it gated to immutable edges (require(isImmutable)),NilTableBindingis a no-op.MutationService.scanDelete(...)exposes it on the write path and capslimitatMAX_SCAN_DELETE_LIMIT(1000) so one call cannot scan-and-delete an unbounded range in a single RPC batch; callers loop to drain a larger range. Enforced at the engine, so every caller is bounded.User-facing surface:
EdgeMutationController:DELETE /graph/v3/databases/{database}/tables/{table}/edges/scan/{index}(start,direction,limit,ranges) →EdgeScanDeleteResponse{database, table, index, deleted}.limitis required (destructive op — force explicit intent). Blocked in read-only mode by the existingReadOnlyRequestFilter(non-GET).Deliberately immutable-only: for a mutable indexed edge, deleting only index rows would leave the State row and count dangling.
How to Test
./gradlew :engine:test --tests "*ImmutableEdgeSpec"— includes a case: append 3 rows,scanDeleteseq <= 1001, assert 2 deleted and only the newer row remains../gradlew :server:test --tests "*ImmutableEdgeE2ETest"— includes E2Es: append thenscanDeletedeletes the matched page and leaves the rest; an over-caplimitis rejected with 400../gradlew :engine:spotlessCheck :server:spotlessCheck.AI Assistance