mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
postgresql migration: Attempt to fix cluster upgrade, complaining that cluster for 13 already existed, suspecting a race condition maybe
This commit is contained in:
parent
ecb8419ee0
commit
89dda11b56
1 changed files with 3 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import time
|
||||
|
||||
from moulinette import m18n
|
||||
from yunohost.utils.error import YunohostError, YunohostValidationError
|
||||
|
@ -42,9 +43,11 @@ class MyMigration(Migration):
|
|||
)
|
||||
|
||||
self.runcmd("systemctl stop postgresql")
|
||||
time.sleep(3)
|
||||
self.runcmd(
|
||||
"LC_ALL=C pg_dropcluster --stop 13 main || true"
|
||||
) # We do not trigger an exception if the command fails because that probably means cluster 13 doesn't exists, which is fine because it's created during the pg_upgradecluster)
|
||||
time.sleep(3)
|
||||
self.runcmd("LC_ALL=C pg_upgradecluster -m upgrade 11 main")
|
||||
self.runcmd("LC_ALL=C pg_dropcluster --stop 11 main")
|
||||
self.runcmd("systemctl start postgresql")
|
||||
|
|
Loading…
Add table
Reference in a new issue