[#1204] shard: Save ID in the metabase

`AddShard` must return shard id, so we temporarily open metabase
there.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-03-01 11:59:05 +03:00 committed by Alex Vanin
parent 1fe9cd4d36
commit 19ad349b27
6 changed files with 108 additions and 13 deletions

View file

@ -96,7 +96,7 @@ func New(opts ...Option) *Shard {
return s
}
// WithID returns option to set shard identifier.
// WithID returns option to set the default shard identifier.
func WithID(id *ID) Option {
return func(c *cfg) {
c.info.ID = id