multi: add --db.sync-graph-cache-load option

Add a new option to opt out of the new asynchronous graph cache loading
feature.
This commit is contained in:
Elle Mouton 2025-07-10 14:05:37 +02:00
parent 4486b5261d
commit eb04d405a2
No known key found for this signature in database
GPG key ID: D7D916376026F177
3 changed files with 11 additions and 0 deletions

View file

@ -1056,6 +1056,9 @@ func (d *DefaultDatabaseBuilder) BuildDatabase(
chanGraphOpts := []graphdb.ChanGraphOption{
graphdb.WithUseGraphCache(!cfg.DB.NoGraphCache),
graphdb.WithAsyncGraphCachePopulation(
!cfg.DB.SyncGraphCacheLoad,
),
}
// We want to pre-allocate the channel graph cache according to what we

View file

@ -89,6 +89,8 @@ type DB struct {
NoGraphCache bool `long:"no-graph-cache" description:"Don't use the in-memory graph cache for path finding. Much slower but uses less RAM. Can only be used with a bolt database backend."`
SyncGraphCacheLoad bool `long:"sync-graph-cache-load" description:"Force synchronous loading of the graph cache. This will block the startup until the graph cache is fully loaded into memory. This is useful if any bugs appear with the new async loading feature of the graph cache."`
PruneRevocation bool `long:"prune-revocation" description:"Run the optional migration that prunes the revocation logs to save disk space."`
NoRevLogAmtData bool `long:"no-rev-log-amt-data" description:"If set, the to-local and to-remote output amounts of revoked commitment transactions will not be stored in the revocation log. Note that once this data is lost, a watchtower client will not be able to back up the revoked state."`

View file

@ -1501,6 +1501,12 @@
; less RAM. Can only be used with a bolt database backend.
; db.no-graph-cache=false
; Block the start-up of LND until the graph cache has been fully populated.
; If not set, the graph cache will be populated asynchronously and any read
; calls made before the cache is fully populated will fall back to the
; database.
; db.sync-graph-cache-load=false
; Specify whether the optional migration for pruning old revocation logs
; should be applied. This migration will only save disk space if there are open
; channels prior to lnd@v0.15.0.