routing: store missioncontrol state in blocks and eliminate cursor use

This commit changes missioncontrol's store update from per payment to
every second. Updating the missioncontrol store on every payment caused
gradual slowdown when using etcd.
We also completely eliminate the use of the cursor, further reducing
the performance bottleneck.
This commit is contained in:
Andras Banki-Horvath
2021-06-25 22:22:12 +02:00
parent 79010cc097
commit 6d80ddfe91
7 changed files with 214 additions and 61 deletions

View File

@@ -43,4 +43,8 @@ type RoutingConfig struct {
// MaxMcHistory defines the maximum number of payment results that
// are held on disk by mission control.
MaxMcHistory int `long:"maxmchistory" description:"the maximum number of payment results that are held on disk by mission control"`
// McFlushInterval defines the timer interval to use to flush mission
// control state to the DB.
McFlushInterval time.Duration `long:"mcflushinterval" description:"the timer interval to use to flush mission control state to the DB"`
}