Maintain graph adjacency table incrementally during ingestion. - #1936
Draft
apognu wants to merge 1 commit into
Draft
Maintain graph adjacency table incrementally during ingestion.#1936apognu wants to merge 1 commit into
apognu wants to merge 1 commit into
Conversation
apognu
force-pushed
the
feat/incremental-graph-building
branch
from
August 19, 2026 08:20
db62509 to
8d91fd4
Compare
apognu
force-pushed
the
feat/incremental-graph-building
branch
from
August 26, 2026 10:53
8d91fd4 to
803dd37
Compare
apognu
force-pushed
the
feat/incremental-graph-building
branch
from
August 26, 2026 10:58
803dd37 to
46d6a4f
Compare
apognu
force-pushed
the
feat/incremental-graph-building
branch
from
August 27, 2026 12:39
46d6a4f to
55ebe36
Compare
`_graph` was previously refreshed only by a periodic full rebuild (default 24h), so a record ingested right after a build was invisible to graph walks until the next cycle. Now we upsert into the table inside the existing ingestion transaction, behind a subtransaction so a failure never fails ingestion itself. Retraction covers a field an ingested version leaves null/empty, which the upsert cannot express since the table has no valid_until. Rework the periodic build's swap to rename the live table aside instead of dropping it, so records ingested while a build is running are reconciled from the previous generation after the swap rather than replayed under a lock that graph read queries would otherwise block on.
apognu
force-pushed
the
feat/incremental-graph-building
branch
from
August 27, 2026 12:45
55ebe36 to
43dd7aa
Compare
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.
_graphwas previously refreshed only by a periodic full rebuild (default 24h), so a record ingested right after a build was invisible to graph walks until the next cycle.Now we upsert into the table inside the existing ingestion transaction, behind a subtransaction so a failure never fails ingestion itself. Retraction covers a field an ingested version leaves null/empty, which the upsert cannot express since the table has no valid_until.
Rework the periodic build's swap to rename the live table aside instead of dropping it, so records ingested while a build is running are reconciled from the previous generation after the swap rather than replayed under a lock that graph read queries would otherwise block on.