MCPcopy Index your code
hub / github.com/cloudnative-pg/cloudnative-pg / Join

Method Join

pkg/management/postgres/join.go:77–97  ·  view source on GitHub ↗

Join creates a new instance joined to an existing PostgreSQL cluster

(ctx context.Context, cluster *apiv1.Cluster)

Source from the content-addressed store, hash-verified

75
76// Join creates a new instance joined to an existing PostgreSQL cluster
77func (info InitInfo) Join(ctx context.Context, cluster *apiv1.Cluster) error {
78 primaryConnInfo := buildPrimaryConnInfo(info.ParentNode, info.PodName) + " dbname=postgres connect_timeout=5"
79
80 // We explicitly disable wal_sender_timeout for join-related pg_basebackup executions.
81 // A short timeout could not be enough in case the instance is slow to send data,
82 // like when the I/O is overloaded.
83 primaryConnInfo += " options='-c wal_sender_timeout=0s'"
84
85 coredumpFilter := cluster.GetCoredumpFilter()
86 if err := system.SetCoredumpFilter(coredumpFilter); err != nil {
87 return err
88 }
89
90 if err := ClonePgData(ctx, primaryConnInfo, info.PgData, info.PgWal); err != nil {
91 return err
92 }
93
94 slotName := cluster.GetSlotNameFromInstanceName(info.PodName)
95 _, err := UpdateReplicaConfiguration(info.PgData, info.GetPrimaryConnInfo(), slotName)
96 return err
97}

Callers 15

discovery_test.goFile · 0.80
CollectLibraryPathsFunction · 0.80
AppendPathsFunction · 0.80
CollectBinPathsFunction · 0.80
reconciler_test.goFile · 0.80
reconciler_test.goFile · 0.80
ExpandEnvPlaceholdersFunction · 0.80
absolutizePathsMethod · 0.80

Calls 7

GetPrimaryConnInfoMethod · 0.95
SetCoredumpFilterFunction · 0.92
buildPrimaryConnInfoFunction · 0.85
ClonePgDataFunction · 0.85
GetCoredumpFilterMethod · 0.80