From dec0f4d467ddee27391697bb80f4f52e46ac945d Mon Sep 17 00:00:00 2001 From: Robert Karlsson Date: Fri, 13 Sep 2024 10:07:41 +0900 Subject: [PATCH] Handle duplicate event inserts gracefully when using Postgresql --- .../netflix/conductor/postgres/dao/PostgresExecutionDAO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresExecutionDAO.java b/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresExecutionDAO.java index aa5233f6b..597c3c7ff 100644 --- a/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresExecutionDAO.java +++ b/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresExecutionDAO.java @@ -903,7 +903,8 @@ private boolean insertEventExecution(Connection connection, EventExecution event String INSERT_EVENT_EXECUTION = "INSERT INTO event_execution (event_handler_name, event_name, message_id, execution_id, json_data) " - + "VALUES (?, ?, ?, ?, ?)"; + + "VALUES (?, ?, ?, ?, ?) " + + "ON CONFLICT DO NOTHING"; int count = query( connection,