@@ -351,8 +351,9 @@ func newConnectionFromOptions(ctx context.Context, opts ...Option) (_ *Driver, e
351351 }()
352352
353353 d := & Driver {
354- children : make (map [uint64 ]* Driver ),
355- ctxCancel : driverCtxCancel ,
354+ children : make (map [uint64 ]* Driver ),
355+ ctxCancel : driverCtxCancel ,
356+ metaBalancer : & balancerWithMeta {},
356357 }
357358
358359 if caFile , has := os .LookupEnv ("YDB_SSL_ROOT_CERTIFICATES_FILE" ); has {
@@ -436,13 +437,15 @@ func (d *Driver) connect(ctx context.Context) (err error) {
436437 if d .pool == nil {
437438 d .pool = conn .NewPool (ctx , d .config )
438439 }
439- if d .metaBalancer == nil {
440+
441+ if d .metaBalancer .balancer == nil {
440442 b , err := balancer .New (ctx , d .config , d .pool , d .discoveryOptions ... )
441443 if err != nil {
442444 return xerrors .WithStackTrace (err )
443445 }
444- d .metaBalancer = & balancerWithMeta { balancer : b , meta : d . config . Meta ()}
446+ d .metaBalancer . balancer = b
445447 }
448+ d .metaBalancer .meta = d .config .Meta ()
446449
447450 d .table = xsync .OnceValue (func () (* internalTable.Client , error ) {
448451 return internalTable .New (xcontext .ValueOnly (ctx ),
0 commit comments