discovery: transit all inactive syncers when needed

This commit is contained in:
yyforyongyu 2021-11-27 05:13:23 +08:00
parent 2250cb752b
commit c15c8a1f0b
No known key found for this signature in database
GPG key ID: 9BCD95C4FF296868

View file

@ -398,6 +398,13 @@ func (m *SyncManager) syncerHandler() {
continue
}
// We may not even have enough inactive syncers to be
// transitted. In that case, we will transit all the
// inactive syncers.
if len(m.inactiveSyncers) < numActiveLeft {
numActiveLeft = len(m.inactiveSyncers)
}
log.Debugf("Attempting to transition %v passive "+
"GossipSyncers to active", numActiveLeft)