@@ -498,6 +498,10 @@ func (c *CartridgeApplication) bootstrapInstance(instanceName, replicasetName st
498
498
UUID : & replicasetUUID ,
499
499
JoinServers : joinOpts ,
500
500
}}
501
+ fmt .Println ("bootstrapInstance: opts:" )
502
+ for i , opt := range opts {
503
+ fmt .Printf ("[%d]: %+v\n " , i , opt )
504
+ }
501
505
return cartridgeEditReplicasets (evaler , opts , timeout )
502
506
}
503
507
@@ -562,6 +566,7 @@ func getCartridgeJoinServersOpts(instancesCfg map[string]cartridgeInstanceConfig
562
566
if _ , UUIDExists := instancesUUID [instance ]; UUIDExists {
563
567
continue
564
568
}
569
+ fmt .Printf ("getCartridgeJoinServersOpts: uuid is missing for instance ''%s\n " , instance )
565
570
cfg , found := instancesCfg [instance ]
566
571
if ! found {
567
572
return nil , fmt .Errorf ("instance %q not found in the instance config" , instance )
@@ -583,17 +588,39 @@ func updateCartridgeReplicasets(evaler connector.Evaler, discovered Replicasets,
583
588
instancesCfg map [string ]cartridgeInstanceConfig ,
584
589
timeout int ,
585
590
) error {
591
+ fmt .Println ("updateCartridgeReplicasets: replicasetCfg:" )
592
+ for k , v := range replicasetCfg {
593
+ fmt .Printf (" %s: %+v\n " , k , v )
594
+ }
595
+ fmt .Println ("updateCartridgeReplicasets: instancesCfg:" )
596
+ for k , v := range instancesCfg {
597
+ fmt .Printf (" %s: %+v\n " , k , v )
598
+ }
599
+
586
600
instanceUUID := map [string ]string {}
587
601
replicasetUUID := map [string ]string {}
602
+ fmt .Println ("updateCartridgeReplicasets: setup UUID maps" )
588
603
for _ , replicaset := range discovered .Replicasets {
604
+ fmt .Printf (" %s: %s\n " , replicaset .Alias , replicaset .UUID )
589
605
replicasetUUID [replicaset .Alias ] = replicaset .UUID
590
606
for _ , instance := range replicaset .Instances {
607
+ fmt .Printf (" %s: %s\n " , instance .Alias , instance .UUID )
591
608
instanceUUID [instance .Alias ] = instance .UUID
592
609
}
593
610
}
611
+ fmt .Println ("updateCartridgeReplicasets: replicasetUUID:" )
612
+ for k , v := range replicasetUUID {
613
+ fmt .Printf (" %s: %s\n " , k , v )
614
+ }
615
+ fmt .Println ("updateCartridgeReplicasets: instanceUUID:" )
616
+ for k , v := range instanceUUID {
617
+ fmt .Printf (" %s: %s\n " , k , v )
618
+ }
594
619
620
+ fmt .Println ("updateCartridgeReplicasets: collect editOpts:" )
595
621
var editOpts []cartridgeEditReplicasetsOpts
596
622
for rname , rcfg := range replicasetCfg {
623
+ fmt .Printf (" %s: %+v\n " , rname , rcfg )
597
624
replicasetName := rname
598
625
opts := cartridgeEditReplicasetsOpts {
599
626
Alias : & replicasetName ,
@@ -605,9 +632,11 @@ func updateCartridgeReplicasets(evaler connector.Evaler, discovered Replicasets,
605
632
if uuid , found := replicasetUUID [replicasetName ]; found {
606
633
// Link opts to the existing replicaset.
607
634
// admin_edit_topology() recognizes replicasets by UUID.
635
+ fmt .Printf (" found replicaset uuid %s\n " , uuid )
608
636
opts .UUID = & uuid
609
637
}
610
638
var err error
639
+
611
640
opts .JoinServers , err = getCartridgeJoinServersOpts (instancesCfg ,
612
641
rcfg .Instances , instanceUUID )
613
642
if err != nil {
@@ -625,6 +654,10 @@ func updateCartridgeReplicasets(evaler connector.Evaler, discovered Replicasets,
625
654
editOpts = append (editOpts , opts )
626
655
}
627
656
657
+ fmt .Println ("updateCartridgeReplicasets: editOpts:" )
658
+ for i , opt := range editOpts {
659
+ fmt .Printf ("[%d]: %+v\n " , i , opt )
660
+ }
628
661
return cartridgeEditReplicasets (evaler , editOpts , timeout )
629
662
}
630
663
0 commit comments