forked from TrueCloudLab/frostfs-node
[#266] services/tree: Add sync check
Do not accept requests until initial sync is finished. `Apply` is deliberately left out -- we don't want to miss anything new. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
e69a1e8482
commit
957a43a124
2 changed files with 41 additions and 1 deletions
|
@ -388,7 +388,7 @@ func (s *Service) syncLoop(ctx context.Context) {
|
|||
s.log.Error(logs.TreeCouldNotFetchContainers, zap.Error(err))
|
||||
s.metrics.AddSyncDuration(time.Since(start), false)
|
||||
span.End()
|
||||
continue
|
||||
break
|
||||
}
|
||||
|
||||
newMap, cnrsToSync := s.containersToSync(cnrs)
|
||||
|
@ -402,6 +402,7 @@ func (s *Service) syncLoop(ctx context.Context) {
|
|||
s.metrics.AddSyncDuration(time.Since(start), true)
|
||||
span.End()
|
||||
}
|
||||
s.initialSyncDone.Store(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue