隔天就会报异常,重启项目就能正常使用
执行的语句select p.id,p.name,p.serise_id,p.description, a.path as 'productImg' from t_product p LEFT JOIN t_attachment a on p.id = a.tid left join t_product_series tps on p.serise_id = tps.id where p.is_del = 0 and tps.system_code = ? order by p.created_date desc LIMIT ?
t_product表分4个表
根据你提供的情况和查询语句,造成间隔性异常的原因可能是由于对t_product表进行了水平分表(sharding),但是在left join t_attachment和t_product_series表时,没有进行相应的分表配置和路由规则,并且在查询时没有指定具体的分表参数,导致查询语句在某些情况下会路由到错误的数据节点,从而发生异常。
解决方法包括:
1.检查sharding-jdbc的配置文件,确保正确配置了t_product表的分表规则和路由策略,以及对应的数据节点;
2.在查询语句中指定具体的分表参数,以确保查询只在正确的数据节点进行;
3.根据异常信息进行排查,定位到具体的出错节点和原因,并进行修复。
希望以上解答能够帮助你解决问题。