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