From be790a45341495a319badc739d2c1beb07bb1a7d Mon Sep 17 00:00:00 2001 From: Weiying Hua <92573864+wy-hua@users.noreply.github.com> Date: Sun, 12 Nov 2023 11:10:41 +0800 Subject: [PATCH] Bugfix/Data inconsistency caused by updateEventHandler (#3843) * remove previous index of event handlers by event if event handler's event gets updated * run ./gradlew spotlessApply --- .../com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java b/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java index c3270706b0..e0aa0bfd8a 100644 --- a/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java +++ b/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java @@ -72,6 +72,9 @@ public void updateEventHandler(EventHandler eventHandler) { throw new NotFoundException( "EventHandler with name %s not found!", eventHandler.getName()); } + if (!existing.getEvent().equals(eventHandler.getEvent())) { + removeIndex(existing); + } index(eventHandler); jedisProxy.hset(nsKey(EVENT_HANDLERS), eventHandler.getName(), toJson(eventHandler)); recordRedisDaoRequests("updateEventHandler");