@@ -102,6 +102,11 @@ done > $tmp_list
102
102
IFS=$OLDIFS
103
103
bm_end " $( basename $0 ) - Building network list"
104
104
105
+ # In cluster environments, we need to ensure that all repository networks are replicated back to the
106
+ # same Spokes nodes that they were present on when the backup was taken. For this, the list of
107
+ # routes of each repository network is first obtained. Afterward, an rsync file list is created for
108
+ # each Spokes node including only those repository networks for which there was a route to the
109
+ # respective Spokes node.
105
110
if $CLUSTER ; then
106
111
# The server returns a list of routes:
107
112
#
@@ -140,9 +145,11 @@ if $CLUSTER; then
140
145
cat $routes_list | awk ' { n = split($1, p, "/"); printf p[n] " /data/repositories/" $1; $1=""; print $0}' > $to_restore
141
146
ghe_debug " \n$( find " $tempdir " -maxdepth 1 -name ' *.rsync' ) "
142
147
bm_end " $( basename $0 ) - Processing routes"
148
+ # There is no need to collect routes and split them by Spokes server in noncluster setups because
149
+ # we need to transfer all repository networks to the primary instance unconditionally, regardless of
150
+ # the Spokes route list captured during the backup. As we already have the list of all repository
151
+ # network paths, we can simply use that as the rsync file list in noncluster environments.
143
152
else
144
- # In noncluster setups, the primary instance owns all repository networks, so all network paths
145
- # are to be synchronized to the primary instance.
146
153
cp " $tmp_list " " $tempdir /git-server-primary.rsync"
147
154
fi
148
155
0 commit comments