From 75cc4f7d7b783c07f2268b70eea426cea8ab4bcf Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Thu, 11 Jan 2024 14:24:21 +0100 Subject: [PATCH] Improve multinode detection in update script Previously we would only check for data nodes defined or distributed hypertables being present which might not be true on data nodes so we prevent update on any installation that has dist_uuid defined which is also true on data nodes. --- sql/updates/latest-dev.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sql/updates/latest-dev.sql b/sql/updates/latest-dev.sql index 70b29b432..2b549a469 100644 --- a/sql/updates/latest-dev.sql +++ b/sql/updates/latest-dev.sql @@ -28,6 +28,13 @@ BEGIN MESSAGE = 'cannot upgrade because multi-node has been removed in 2.14.0', DETAIL = 'The following data nodes should be removed: '||data_nodes; END IF; + + IF EXISTS(SELECT FROM _timescaledb_catalog.metadata WHERE key = 'dist_uuid') THEN + RAISE USING + ERRCODE = 'feature_not_supported', + MESSAGE = 'cannot upgrade because multi-node has been removed in 2.14.0', + DETAIL = 'This node appears to be part of a multi-node installation'; + END IF; END $$; DROP FUNCTION IF EXISTS _timescaledb_functions.ping_data_node;