mirror of https://github.com/citusdata/citus.git
Don't collect stats when there is a version mismatch. (#1712)
The following scenario can cause an Assert() crash if we don't do this: - Install Citus v7.0-15 - Restart server & run a query to start maintenanced. - Install Citus v7.1 - Restart server & run a query. This will tell user to upgrade. - Type "UPDATE EXTENSION c" & press tab. maintenanced will start and crash with Assert(CitusHasBeenLoaded() && CheckCitusVersion(WARNING)); This change checks Citus version before calling metadata functions so the crash doesn't happen.pull/1724/head
parent
e4072a3dbb
commit
86bcd93a4a
|
@ -65,6 +65,17 @@ CollectBasicUsageStatistics(void)
|
||||||
memset(&unameData, 0, sizeof(unameData));
|
memset(&unameData, 0, sizeof(unameData));
|
||||||
|
|
||||||
StartTransactionCommand();
|
StartTransactionCommand();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If there is a version mismatch between loaded version and available
|
||||||
|
* version, metadata functions will fail. We return early to avoid crashing.
|
||||||
|
* This can happen when updating the Citus extension.
|
||||||
|
*/
|
||||||
|
if (!CheckCitusVersion(LOG_SERVER_ONLY))
|
||||||
|
{
|
||||||
|
CommitTransactionCommand();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
distributedTables = DistributedTableList();
|
distributedTables = DistributedTableList();
|
||||||
roundedDistTableCount = NextPow2(list_length(distributedTables));
|
roundedDistTableCount = NextPow2(list_length(distributedTables));
|
||||||
roundedClusterSize = NextPow2(ClusterSize(distributedTables));
|
roundedClusterSize = NextPow2(ClusterSize(distributedTables));
|
||||||
|
|
Loading…
Reference in New Issue