perf(deps): scan one cycle table for same-storage edges (#4004)

* perf(deps): narrow recursive cycle checks

* fix(deps): keep mixed-table cycle detection

* fix(deps): preserve mixed-table wisp cycle scans
This commit is contained in:
Julian Knutsen 2026-05-17 15:06:01 -07:00 • committed by GitHub
commit a4ebe8ffec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -113,6 +113,12 @@ func setupTestStore(t *testing.T) (*DoltStore, func()) {
// Create an isolated branch for this test
_, branchCleanup := testutil.StartTestBranch(t, store.db, testSharedDB)
if err := initSchemaOnDB(ctx, store.db); err != nil {
branchCleanup()
store.Close()
os.RemoveAll(tmpDir)
t.Fatalf("failed to initialize branch-local ignored schema: %v", err)
}
cleanup := func() {
branchCleanup()

View file

@ -54,8 +54,9 @@ type AddDependencyOpts struct {
// WriteTable is the dependency table to insert/update/check existing deps in.
// Auto-detected from source wisp routing if empty.
WriteTable string
// DepTables are the tables to scan for cycle detection. The recursive CTE
// UNIONs all of them. Defaults to ["dependencies", "wisp_dependencies"] if empty.
// DepTables are the tables to scan for cycle detection. Defaults to both
// dependency tables; edge storage is source-routed, so same-class endpoints
// can still have mixed-table interior paths.
DepTables []string
// IsCrossPrefix is true when source and target have different prefixes,
// meaning the target lives in another rig's database.