[#1902] node: Sync all the trees on bootstrap

Do not limit synchronization by "system" and "version" tree IDs.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-10-18 17:21:16 +03:00 committed by Pavel Karpy
parent 1766ca2039
commit aa37078570

View file

@ -76,22 +76,16 @@ func syncTrees(ctx context.Context, treeSvc *tree.Service, cnrCli *containerClie
return
}
// TODO: #1902 fetch all the trees via a new tree RPC
wellKnownTrees := [...]string{"version", "system"}
for _, id := range ids {
for i := range wellKnownTrees {
err = treeSvc.SynchronizeTree(ctx, id, wellKnownTrees[i])
err = treeSvc.SynchronizeAllTrees(ctx, id)
if err != nil && !errors.Is(err, tree.ErrNotInContainer) {
log.Warn(
"tree synchronization failed",
zap.Stringer("cid", id),
zap.String("tree_id", wellKnownTrees[i]),
zap.Error(err),
)
}
}
}
log.Info("trees have been synchronized")
}