()
| 748 | } |
| 749 | |
| 750 | func (sh *SyncHandler) runFullValidation() { |
| 751 | var wg sync.WaitGroup |
| 752 | |
| 753 | sh.mu.Lock() |
| 754 | shards := sh.vshards |
| 755 | wg.Add(len(shards)) |
| 756 | sh.mu.Unlock() |
| 757 | |
| 758 | sh.logf("full validation beginning with %d shards...", len(shards)) |
| 759 | |
| 760 | const maxShardWorkers = 30 // arbitrary |
| 761 | gate := syncutil.NewGate(maxShardWorkers) |
| 762 | |
| 763 | for _, pfx := range shards { |
| 764 | pfx := pfx |
| 765 | gate.Start() |
| 766 | go func() { |
| 767 | defer wg.Done() |
| 768 | defer gate.Done() |
| 769 | sh.validateShardPrefix(pfx) |
| 770 | }() |
| 771 | } |
| 772 | wg.Wait() |
| 773 | sh.logf("validation complete") |
| 774 | } |
| 775 | |
| 776 | func (sh *SyncHandler) validateShardPrefix(pfx string) (err error) { |
| 777 | defer func() { |
no test coverage detected