File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -898,6 +898,9 @@ async def check_nodes():
898898 except FatalException as ex :
899899 self .log .critical (ex )
900900 exit (SHUTDOWN )
901+ except InFailedSqlTransaction :
902+ # we should only be here when the CLUSTER table does not exist yet
903+ raise
901904 except Exception as ex :
902905 self .log .exception (ex )
903906 raise
Original file line number Diff line number Diff line change @@ -81,16 +81,13 @@ async def install(self) -> bool:
8181 if await super ().install ():
8282 try :
8383 async with self .apool .connection () as conn :
84- await conn .execute ("""
85- UPDATE plugins
86- SET version = (
87- SELECT version FROM plugins WHERE plugin = 'serverstats'
88- )
89- WHERE plugin = 'monitoring'
90- """ )
91- cursor = await conn .execute ("DELETE FROM plugins WHERE plugin = 'serverstats' RETURNING plugin" )
84+ cursor = await conn .execute ("SELECT version FROM plugins WHERE plugin = 'serverstats'" )
9285 row = await cursor .fetchone ()
9386 if row :
87+ async with conn .transaction ():
88+ await conn .execute ("UPDATE plugins SET version = %s WHERE plugin = 'monitoring'" ,
89+ (row [0 ], ))
90+ await conn .execute ("DELETE FROM plugins WHERE plugin = 'serverstats'" )
9491 self .log .info (" => Migrating serverstats to monitoring. Restart triggered ..." )
9592 await self .node .restart ()
9693 return True
You can’t perform that action at this time.
0 commit comments