File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ RUN cd /usr/src/ && \
28
28
curl -s https://github.com/kubeovn/ovs/commit/b721a251dadfb0857a2aebe32611d18ca935421f.patch | git apply && \
29
29
# ovsdb-tool: add optional server id parameter for "join-cluster" command
30
30
curl -s https://github.com/kubeovn/ovs/commit/0664cbe47d1684ca5b7147e3449779635454970e.patch | git apply && \
31
+ # ovsdb-tool: add command fix-cluster
32
+ curl -s https://github.com/kubeovn/ovs/commit/f52c239f5ded40b503e4d217f916b46ca413da4c.patch | git apply && \
31
33
# fix memory leak in qos
32
34
curl -s https://github.com/kubeovn/ovs/commit/6a4dd2f4b9311a227cc26fef7c398ae9b241311b.patch | git apply && \
33
35
# compile without avx512
Original file line number Diff line number Diff line change @@ -124,7 +124,14 @@ function ovn_db_pre_start() {
124
124
! ovsdb-tool db-is-clustered " $db_file " && return
125
125
ovsdb-tool check-cluster " $db_file " && return
126
126
127
- echo " detected database corruption for file $db_file , rebuild it."
127
+ local db_bak=" $db_file .backup-$( date +%s) -$( random_str) "
128
+ echo " backup $db_file to $db_bak "
129
+ cp " $db_file " " $db_bak " || return 1
130
+
131
+ echo " detected database corruption for file $db_file , try to fix it."
132
+ ovsdb-tool fix-cluster " $db_file " && return
133
+
134
+ echo " failed to fix database file $db_file , rebuild it."
128
135
local sid=$( ovsdb-tool db-sid " $db_file " )
129
136
if ! echo -n " $sid " | grep -qE ' ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' ; then
130
137
echo " failed to get sid from $1 db file $db_file "
@@ -148,10 +155,6 @@ function ovn_db_pre_start() {
148
155
echo " generating new database file $db_new "
149
156
ovsdb-tool --sid $sid join-cluster " $db_new " $db $local_addr ${remote_addr[*]} || return 1
150
157
151
- local db_bak=" $db_file .backup-$( random_str) "
152
- echo " backup $db_file to $db_bak "
153
- mv " $db_file " " $db_bak " || return 1
154
-
155
158
echo " use new database file $db_new "
156
159
mv " $db_new " " $db_file "
157
160
}
You can’t perform that action at this time.
0 commit comments