wanggd2019

Results 5 comments of wanggd2019

我是重写com.codingapi.txlcn.tm.core.storage.redis.RedisStorage,注释掉事务相关的代码,加啥事务, public void refreshMachines(long timeout, long... machines) { try { /*stringRedisTemplate.setEnableTransactionSupport(true); stringRedisTemplate.multi();*/ log.info("refreshMachines....."); for (long mac : machines) { stringRedisTemplate.opsForValue().set(REDIS_MACHINE_ID_MAP_PREFIX + mac, "", timeout, TimeUnit.MILLISECONDS); } //stringRedisTemplate.exec(); } catch (Throwable...

我觉着没有必要加事务

TM心跳检测的时候,会调用到 RedisStorage的refreshMachines,应该为了剔除不活动的TM,但是refreshMachines方法中使用了事务相关的代码,reids-cluster不支持事务操作,所以报了上面的错误,com.sun.proxy.$Proxy141 cannot be cast to io.lettuce.core.api.sync.RedisCommands

刚看了一下参数的配置说明,这个base_path主要用了存储日志,如果没有配置store_path才会使用base_path存储文件,实际上的效果也是这样的,base_path中存储这storage.log和pid等文件,哈哈