Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tapdb: fixes another issue with the syncer cache #1345

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions itest/tapd_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ type harnessOpts struct {
// sqliteDatabaseFilePath is the path to the SQLite database file to
// use.
sqliteDatabaseFilePath *string

// disableSyncCache is a flag that can be set to true to disable the
// universe syncer cache.
disableSyncCache bool
}

type harnessOption func(*harnessOpts)
Expand Down Expand Up @@ -283,6 +287,10 @@ func newTapdHarness(t *testing.T, ht *harnessTest, cfg tapdConfig,
finalCfg.Universe.SyncInterval = *opts.fedSyncTickerInterval
}

if !opts.disableSyncCache {
finalCfg.Universe.MultiverseCaches.SyncerCacheEnabled = true
}

return &tapdHarness{
cfg: &cfg,
clientCfg: finalCfg,
Expand Down
4 changes: 4 additions & 0 deletions itest/test_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ type tapdHarnessParams struct {
// sqliteDatabaseFilePath is the path to the SQLite database file to
// use.
sqliteDatabaseFilePath *string

// disableSyncCache indicates whether the sync cache should be disabled.
disableSyncCache bool
}

type Option func(*tapdHarnessParams)
Expand Down Expand Up @@ -413,6 +416,7 @@ func setupTapdHarness(t *testing.T, ht *harnessTest,
ho.addrAssetSyncerDisable = params.addrAssetSyncerDisable
ho.fedSyncTickerInterval = params.fedSyncTickerInterval
ho.sqliteDatabaseFilePath = params.sqliteDatabaseFilePath
ho.disableSyncCache = params.disableSyncCache
}

tapdCfg := tapdConfig{
Expand Down
2 changes: 1 addition & 1 deletion tapdb/multiverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ func (b *MultiverseStore) UpsertProofLeaf(ctx context.Context,
b.syncerCache.addOrReplace(universe.Root{
ID: id,
AssetName: leaf.Asset.Tag,
Node: issuanceProof.MultiverseRoot,
Node: issuanceProof.UniverseRoot,
})

// Notify subscribers about the new proof leaf, now that we're sure we
Expand Down
Loading