Repository navigation
Push and pull apply graph drops - #2272
Merged
Merged
Conversation
Commit transfer refused a commit that drops graphs, since it applied nothing of the drop. Each transferred commit now applies as replay applies it: its drops at its t, then the dropped graphs it writes again, then its flakes, and the receiver's index stops serving what the drops took. A commit that only drops is not an empty commit. A push validates each commit against the state the drops before it leave, and takes the policy from the state before the commit: only an identity without a restricting policy may push a drop, as only one may drop locally. A commit a merge brought in is still refused if it drops, since a merge never brings one in. The CLI names an earlier release on the remote when it refuses the commit flag.
jdorety
approved these changes
Nov 9, 2026
jdorety
left a comment
There was a problem hiding this comment.
LGTM. Drop/revive ordering, applying drops in both validation and apply, the unrestricted-identity check, and store hiding all hold up; the new tests pass and fail when they should.
Non-blocking hardening, both reachable only with hand-crafted commits from an unrestricted identity:
- A no-flake commit whose
graph_dropsnames only unknown or system graphs passes the empty-commit check on push and pull and is stored as a no-op commit. - A drop of a graph first registered by a later commit in the same push is accepted; reload and per-commit peer catch-up then record different drop metadata (no read difference observed).
Share drop-target validation between push and incremental pull. Reject unknown and system graphs and targets introduced only by a later commit, while preserving same-commit registration. Share drop and revival application with peer catch-up, remove copied graph names, and compare lifecycle metadata across transfer, catch-up, reload, and indexing.
Build a membership set for large drop lists and stores while retaining cheap slice scans for small inputs. Verify masking preserves shared indexes and handles unordered, duplicate, and unknown graph IDs.
Report unsupported commit format features generically and preserve the remote error. Cover drop and non-drop flags in the compatibility-message regression test.
Contributor
Author
|
Addressed in 258ef37 |
Contributor
bplatz
added a commit
that referenced
this pull request
Nov 11, 2026
A branch that starts from its source's index loads its historical snapshots from that root, which names the source. The head load re-stamps the record's ledger id; the historical loader did not, so a view as of an earlier `t` carried the source's id with the branch's fence, and the retention freshness check refused it as dropped. Every time-travel read of such a branch below its head failed; #2272's push/pull drop test reads those views.
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.
Fixes #2252
Summary
Push and pull refused every commit that drops a graph: commit transfer recorded a drop's revivals but never applied the drop. A transferred commit now applies as replaying it does: its drops at its
t, then the dropped graphs it writes again, then its flakes. The receiver's index then stops serving what the drops took, so the receiver reads what the writer reads, at the head and as of anyt.Changes
fluree-db-api/src/commit_transfer.rs:apply_pushed_commits_to_state, shared by push and incremental pull): each commit's drops and revivals (apply_graph_lifecycle) run before its flakes, in commit order, replacing the batch revive loop.hide_dropped_graphsruns afterward when the transfer drops anything. A pull split into pages applies each page onto the state the previous one left.prepare_push): each commit is checked against the state the drops before it leave (validate_after_graph_lifecycle), so retraction checks, staging, SHACL and vector lengths see what the writer saw. A push that carries a drop registers its graphs on the validation state up front, under the ids routing already gives them, so a graph created, dropped and written again within one push resolves.drop_needs_unrestricted_identity, now exported byfluree-db-transact. The order matters: withf:defaultAllowand deny policies stored in the default graph, aDROP DEFAULTjudged after its own drop would find no policy and pass as root.merged_commitsis still refused, with a new message: a merge never brings one in (refuse_merging_graph_drops), and merged commits are stored without replay.Clone and pack pull already handled drops: they write the commit blobs and reload, and the reload replays the drops.
CLI:
push_failureexplains a refusal of the drop's commit flag (unknown envelope flags: 0x20) as a remote on an earlier release.Docs: the
DROPsection ofcompatibility.md, and the push chain rules,403and merged-commit rule inendpoints.md.Transfers without drops do the work they did before. The per-commit step in apply returns at once for a commit that drops nothing, and the revive check it makes was already there. The validation-side steps run only for a push that carries a drop.
Tests
it_graph_drop::push_and_pull_apply_drops_as_the_writer_did: a push, a pull, and a pull one commit at a time, onto receivers that start from an index holding the graphs the commits drop. Each receiver must read what the writer reads at everyt, again after a reload, and the pushed one again after its own index build. The commits include a drop alone, a write of the dropped graph again, a graph registered, dropped and written again within the transfer, andDROP DEFAULT.it_graph_drop::a_push_validates_a_commit_after_its_drop: a vector at a new length, written after its graph's drop, is accepted.it_graph_drop::a_push_that_drops_needs_an_identity_without_a_restricting_policy: aDROP DEFAULTpushed by an identity whose deny policy lives in the default graph gets a 403; the same identity's push of a commit that drops nothing is accepted.a_push_refused_for_an_unknown_commit_flag_names_the_remote_release.Not covered
prepare_push.