@@ -64,8 +64,8 @@ func NewNode() (*Node, error) {
64
64
}
65
65
node .PrivateIP = ipv6 .String ()
66
66
67
- machineID := os .Getenv ("FLY_ALLOC_ID" )
68
67
// Generate a random, reconstructable signed int32
68
+ machineID := os .Getenv ("FLY_ALLOC_ID" )
69
69
seed := binary .LittleEndian .Uint64 ([]byte (machineID ))
70
70
rand .Seed (int64 (seed ))
71
71
node .ID = rand .Int31 ()
@@ -119,11 +119,6 @@ func (n *Node) Init() error {
119
119
return fmt .Errorf ("failed to query current primary: %s" , err )
120
120
}
121
121
122
- // Initialize PGBouncer
123
- if err := n .PGBouncer .configure (primaryIP ); err != nil {
124
- return err
125
- }
126
-
127
122
// Writes or updates the replication manager configuration.
128
123
if err := initializeRepmgr (* n ); err != nil {
129
124
fmt .Printf ("Failed to initialize replmgr: %s\n " , err .Error ())
@@ -176,9 +171,10 @@ func (n *Node) Init() error {
176
171
return fmt .Errorf ("failed to configure postgres %s" , err )
177
172
}
178
173
179
- fmt .Println ("Configuring pgbouncer auth" )
180
- if err := n .PGBouncer .configureAuth (); err != nil {
181
- return fmt .Errorf ("failed to configure pgbouncer auth %s" , err )
174
+ // Initialize PGBouncer
175
+ fmt .Println ("Configuring PGBouncer" )
176
+ if err := n .PGBouncer .configure (primaryIP ); err != nil {
177
+ return err
182
178
}
183
179
184
180
return nil
0 commit comments