From 205501532a59c0bf746e6518b6842882e26a3c71 Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Mon, 14 Aug 2017 15:46:18 +0300 Subject: [PATCH] Add version check to the maintenance daemon We should prevent running the deadlock detection if there is a major version change. Otherwise, the daemon may access to obsolete metadata catalog tables. --- src/backend/distributed/utils/maintenanced.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/backend/distributed/utils/maintenanced.c b/src/backend/distributed/utils/maintenanced.c index 2bf847455..fe33c7a26 100644 --- a/src/backend/distributed/utils/maintenanced.c +++ b/src/backend/distributed/utils/maintenanced.c @@ -266,7 +266,16 @@ CitusMaintenanceDaemonMain(Datum main_arg) if (DistributedDeadlockDetectionTimeoutFactor != -1.0) { StartTransactionCommand(); - foundDeadlock = CheckForDistributedDeadlocks(); + + /* + * We don't want to run the deadlock checks if there exists + * any version mistmatch. + */ + if (CheckCitusVersion(DEBUG1)) + { + foundDeadlock = CheckForDistributedDeadlocks(); + } + CommitTransactionCommand(); /*