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 committed 2021-07-26 17:02:11 +02:00
1 parent 79010cc097
commit 6d80ddfe91
7 files changed
+214 -61

No files matched your search

+8
View File
@@ -746,6 +746,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
&routing.MissionControlConfig{
ProbabilityEstimatorCfg: estimatorCfg,
MaxMcHistory: routingConfig.MaxMcHistory,
McFlushInterval: routingConfig.McFlushInterval,
MinFailureRelaxInterval: routing.DefaultMinFailureRelaxInterval,
},
)
@@ -1663,6 +1664,12 @@ func (s *server) Start() error {
return nil
})
s.missionControl.RunStoreTicker()
cleanup.add(func() error {
s.missionControl.StopStoreTicker()
return nil
})
// Before we start the connMgr, we'll check to see if we have
// any backups to recover. We do this now as we want to ensure
// that have all the information we need to handle channel
@@ -1869,6 +1876,7 @@ func (s *server) Stop() error {
srvrLog.Warnf("failed to stop chanSubSwapper: %v", err)
}
s.chanEventStore.Stop()
s.missionControl.StopStoreTicker()
// Disconnect from each active peers to ensure that
// peerTerminationWatchers signal completion to each peer.