forked from TrueCloudLab/frostfs-node
[#266] services/tree: Return operation log up to some height
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>fix/wc_metrics_labels
parent
2541d319de
commit
e69a1e8482
|
@ -532,9 +532,13 @@ func (s *Service) GetOpLog(req *GetOpLogRequest, srv TreeService_GetOpLogServer)
|
|||
}
|
||||
|
||||
h := b.GetHeight()
|
||||
lastHeight, err := s.forest.TreeHeight(srv.Context(), cid, b.GetTreeId())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for {
|
||||
lm, err := s.forest.TreeGetOpLog(srv.Context(), cid, b.GetTreeId(), h)
|
||||
if err != nil || lm.Time == 0 {
|
||||
if err != nil || lm.Time == 0 || lastHeight < lm.Time {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue