From d8c1383630d34fbafe14803133cb4a5f1a3f8989 Mon Sep 17 00:00:00 2001 From: Pawel Leszczynski Date: Thu, 29 Jun 2023 15:42:51 +0200 Subject: [PATCH] remove unnecessary updates which are deadlock prone Signed-off-by: Pawel Leszczynski --- CHANGELOG.md | 3 +++ api/src/main/java/marquez/db/SourceDao.java | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c72892c471..b95576c982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## [Unreleased](https://github.com/MarquezProject/marquez/compare/0.36.0...HEAD) +### Fixed +* API: remove unnecessary DB updates [`#2531`](https://github.com/MarquezProject/marquez/pull/2531)[@pawel-big-lebowski]( https://github.com/pawel-big-lebowski) + *Prevent updates that are not needed and are deadlock prone.* ## [0.36.0](https://github.com/MarquezProject/marquez/compare/0.35.0...0.36.0) - 2023-06-27 ### Added diff --git a/api/src/main/java/marquez/db/SourceDao.java b/api/src/main/java/marquez/db/SourceDao.java index 9702a5c44f..de709921dc 100644 --- a/api/src/main/java/marquez/db/SourceDao.java +++ b/api/src/main/java/marquez/db/SourceDao.java @@ -50,7 +50,6 @@ public interface SourceDao { + ") ON CONFLICT(name) DO UPDATE SET " + "type = EXCLUDED.type, " + "updated_at = EXCLUDED.updated_at, " - + "name = EXCLUDED.name, " + "connection_url = EXCLUDED.connection_url " + "RETURNING *") SourceRow upsert(UUID uuid, String type, Instant now, String name, String connectionUrl); @@ -75,7 +74,6 @@ public interface SourceDao { + ") ON CONFLICT(name) DO UPDATE SET " + "type = EXCLUDED.type, " + "updated_at = EXCLUDED.updated_at, " - + "name = EXCLUDED.name, " + "connection_url = EXCLUDED.connection_url, " + "description = EXCLUDED.description " + "RETURNING *")