From fcd5c19356a9fa4290d14c14b692d8f656c67e7d Mon Sep 17 00:00:00 2001 From: ayue Date: Mon, 23 Sep 2024 09:13:15 +0800 Subject: [PATCH] fix: When use redis store event, incorrect key was used to query the InstanceMeta Signed-off-by: ayue --- .../java/io/sermant/backend/common/conf/CommonConst.java | 5 ----- .../java/io/sermant/backend/dao/redis/RedisClientImpl.java | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/sermant-backend/src/main/java/io/sermant/backend/common/conf/CommonConst.java b/sermant-backend/src/main/java/io/sermant/backend/common/conf/CommonConst.java index 5e427c6c82..c4cdfc908a 100644 --- a/sermant-backend/src/main/java/io/sermant/backend/common/conf/CommonConst.java +++ b/sermant-backend/src/main/java/io/sermant/backend/common/conf/CommonConst.java @@ -63,11 +63,6 @@ public class CommonConst { */ public static final int DEFAULT_REDIS_PORT = 6379; - /** - * redis hash key of instance meta - */ - public static final String REDIS_HASH_KEY_OF_INSTANCE_META = "sermant_meta"; - /** * redis event key */ diff --git a/sermant-backend/src/main/java/io/sermant/backend/dao/redis/RedisClientImpl.java b/sermant-backend/src/main/java/io/sermant/backend/dao/redis/RedisClientImpl.java index 488fdf3470..a5d951c204 100644 --- a/sermant-backend/src/main/java/io/sermant/backend/dao/redis/RedisClientImpl.java +++ b/sermant-backend/src/main/java/io/sermant/backend/dao/redis/RedisClientImpl.java @@ -192,7 +192,7 @@ public void cleanOverDueEventTimerTask() { @Override public QueryResultEventInfoEntity getDoNotifyEvent(Event event) { QueryResultEventInfoEntity queryResultEventInfoEntity = new QueryResultEventInfoEntity(); - String instanceMeta = redisOperation.hget(CommonConst.REDIS_HASH_KEY_OF_INSTANCE_META, event.getMetaHash()); + String instanceMeta = redisOperation.get(event.getMetaHash()); if (!DbUtils.isEmpty(instanceMeta)) { InstanceMeta agentInstanceMeta = JSONObject.parseObject(instanceMeta, InstanceMeta.class); queryResultEventInfoEntity = DbUtils.aggregationEvent(event, agentInstanceMeta);