首页 > 数据库 >记一次Redis实施故障

记一次Redis实施故障

时间:2022-11-04 18:25:54浏览次数:72  
标签:java 实施 AbstractChannelHandlerContext redis Redis springframework 故障 io org

服务在测试环境运行没问题,部署到生产环境,连redis时报下面的错误:

[2022-11-04 00:00:09][org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler->handleError#96][ERROR][]: Unexpected error occurred in scheduled task. org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'multi' at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:54) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:52) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:268) at org.springframework.data.redis.connection.lettuce.LettuceConnection.multi(LettuceConnection.java:672) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.data.redis.core.RedisConnectionUtils$ConnectionSplittingInterceptor.invoke(RedisConnectionUtils.java:351) at org.springframework.data.redis.core.RedisConnectionUtils$ConnectionSplittingInterceptor.intercept(RedisConnectionUtils.java:329) at org.springframework.data.redis.core.RedisConnectionUtils$ConnectionSplittingInterceptor.invoke(RedisConnectionUtils.java:359) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy138.multi(Unknown Source) at org.springframework.data.redis.core.RedisConnectionUtils.potentiallyRegisterTransactionSynchronisation(RedisConnectionUtils.java:163) at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:145) at org.springframework.data.redis.core.RedisConnectionUtils.bindConnection(RedisConnectionUtils.java:70) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:209) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184) at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95) at org.springframework.data.redis.core.DefaultValueOperations.set(DefaultValueOperations.java:256) at org.springframework.data.redis.core.ValueOperations.set(ValueOperations.java:75) at com.tencent.wll.gridmgroptjob.scheduled.SyyldryxxTask.syncSyyldryxx(SyyldryxxTask.java:126) at com.tencent.wll.gridmgroptjob.scheduled.SyyldryxxTask$$FastClassBySpringCGLIB$$536ad357.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at com.tencent.wll.gridmgroptjob.scheduled.SyyldryxxTask$$EnhancerBySpringCGLIB$$bfb14350.syncSyyldryxx(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'multi' at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:135) at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:108) at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120) at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111) at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:646) at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:604) at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:556) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:433) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:330) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ... 1 common frames omitted

排查jar包、redis配置文件都没异常,经高人指点,发下可能是Redis中的Multi事务冲突了,可能是同步服务在写redis,而其他服务正在读redis,引起了冲突,检查程序里的RedisConfig文件,果然有个有个配置是开启了事务,便删掉下面的代码,重启,问题解决。
//开启事物的代码,该值默认是false redisTemplate.setEnableTransactionSupport(true);

参考链接:
https://blog.csdn.net/qq_25438391/article/details/114651459?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-3-114651459-blog-123724965.pc_relevant_recovery_v2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-3-114651459-blog-123724965.pc_relevant_recovery_v2&utm_relevant_index=6

标签:java,实施,AbstractChannelHandlerContext,redis,Redis,springframework,故障,io,org
From: https://www.cnblogs.com/andy020/p/16858692.html

相关文章

  • 将轮播图数据缓存到redis中
    #classBannerView(GenericAPIView,ListModelMixin):#继承这两个类的路由是path('banner/',views.BannerView.as_view()),classBannerView(GenericViewSet,ListModelM......
  • 记一次Oracle在导出和导入过程中对ORA-01555/ORA-01628/ORA-30036进行故障排除过程
    那是在2021年7月30日的下午,在整理公司服务器中备份文件时发现的问题当时发现备份的数据虽然有文件,但是日志中存在报错,并且备份出来的文件无法进行还原因为没遇到过这个......
  • RedisGeo
    前言  项目中有个经纬度的计算距离需求,想起redis中的GEO数据类型可以实现,记录下GEO的使用。 什么是GEO  GEO是Redis的一种数据类型,在Redis3.2新增的功能,主要用于......
  • 硬盘分类和故障考虑
    硬盘分为固态硬盘和机械硬盘,固态硬盘读取速度快,但硬盘出现问题后数据难以恢复;机械硬盘则相反一、从接口上讲,分为ATA、SATA、mSATA、m2三类ATA:老式的接口,并行ATA,俗称IDE,非......
  • Redis学习
    学习视频:【尚硅谷】Redis6入门到精通超详细教程_哔哩哔哩_bilibili笔记:Redis|ZC的学习录(zhangc233.github.io)......
  • Oracle故障处理:Rman delete obsolete报错ORA-19606解决
    在使用rman维护数据库备份记录的时候,通过deleteobsolete命令删除文件的时候发生了ora-19606,具体报错如下:RMAN>deleteobsolete;RMANretentionpolicywillbeappliedto......
  • Spring Boot缓存实战 Redis 设置有效时间和自动刷新缓存,时间支持在配置文件中配置
    问题描述SpringCache提供的@Cacheable注解不支持配置过期时间,还有缓存的自动刷新。我们可以通过配置CacheManneg来配置默认的过期时间和针对每个缓存容器(value)单独配置过......
  • Spring Boot缓存实战 Redis 设置有效时间和自动刷新缓存-2
    问题上一篇​​SpringBootCache+redis设置有效时间和自动刷新缓存,时间支持在配置文件中配置​​,说了一种时间方式,直接扩展注解的Value值,如:@Override@Cacheable(value=......
  • Spring Boot缓存实战 Redis + Caffeine 实现多级缓存
    在前文我们介绍了如何使用Redis或者Caffeine来做缓存。​​SpringBoot缓存实战Redis设置有效时间和自动刷新缓存-2​​​​SpringBoot缓存实战Caffeine​​问题描述:通......
  • 基于redis实现的扣减库存
    在日常开发中有很多地方都有类似扣减库存的操作,比如电商系统中的商品库存,抽奖系统中的奖品库存等。解决方案使用mysql数据库,使用一个字段来存储库存,每次扣减库存去更新这个......