fe.warn.log Invalid tablet id

【详述】
在检查 fe.warn.log 的时候, 发现有错误日志

2024-08-23 18:34:36.817+08:00 WARN (AutoStatistic|27) [StatisticExecutor.collectStatistics():287] Collect statistics error
 com.starrocks.common.DdlException: Invalid tablet id: '2474027'

发生在 sql

  sql INSERT INTO _statistics_.table_statistic_v1  。。。。。。

检查tablet 信息

show tablet 2474027
partitionName : $shadow_automatic_partition

SHOW TABLET FROM yh_danmu_detail_daily partition($shadow_automatic_partition);
  出现了一些 data 为空 的 分区

image

【背景】升级了 3.3.2
【业务影响】 yh_danmu_detail_daily 在table_statistic_v1 里的数据三天没有更新了
【是否存算分离】是
【StarRocks版本】3.3.2
【附件】

fe.warn.log

2024-08-23 18:34:36.817+08:00 WARN (AutoStatistic|27) [StatisticExecutor.collectStatistics():287] Collect statistics error
 com.starrocks.common.DdlException: Invalid tablet id: '2474027'
        at com.starrocks.statistic.StatisticsCollectJob.collectStatisticSync(StatisticsCollectJob.java:160)
        at com.starrocks.statistic.SampleStatisticsCollectJob.collect(SampleStatisticsCollectJob.java:79)
        at com.starrocks.statistic.StatisticExecutor.collectStatistics(StatisticExecutor.java:285)
        at com.starrocks.statistic.StatisticAutoCollector.runAfterCatalogReady(StatisticAutoCollector.java:86)
        at com.starrocks.common.util.FrontendDaemon.runOneCycle(FrontendDaemon.java:72)
        at com.starrocks.common.util.Daemon.run(Daemon.java:107)

补充个信息 : tablet id 对应的 partitionId , 在show partitions 里 看不到。
Name |Value |
-------------±------------------------------------------------------------------+
DbName |es |
TableName |yh_danmu_detail_daily |
PartitionName|$shadow_automatic_partition |
IndexName |yh_danmu_detail_daily |
DbId |177220 |
TableId |2300951 |
PartitionId |2303654 |
IndexId |2474026 |
IsSync |true |
DetailCmd |SHOW PROC ‘/dbs/177220/2300951/partitions/2303654/2474026/2474027’;|

我之前用的是 3.2.8 没问题, 升级 3.3.2 之后才有的, 我仔细看了,这些partition id的分区。 应该是已经被我手动删了的,不清楚为啥被归为了 shadow_automatic_partition。

java.lang.IllegalStateException: Invalid tablet id: '2474027' at com.google.common.base.Preconditions.checkState(Preconditions.java:512) at com.starrocks.planner.OlapScanNode.mapTabletsToPartitions(OlapScanNode.java:1326) at com.starrocks.planner.OlapScanNode.updateScanInfo(OlapScanNode.java:1041) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalOlapScan(PlanFragmentBuilder.java:795) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalOlapScan(PlanFragmentBuilder.java:408) at com.starrocks.sql.optimizer.operator.physical.PhysicalOlapScanOperator.accept(PhysicalOlapScanOperator.java:201) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visit(PlanFragmentBuilder.java:456) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalDistribution(PlanFragmentBuilder.java:2286) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalDistribution(PlanFragmentBuilder.java:408) at com.starrocks.sql.optimizer.operator.physical.PhysicalDistributionOperator.accept(PhysicalDistributionOperator.java:75) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visit(PlanFragmentBuilder.java:456) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalLimit(PlanFragmentBuilder.java:3185) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalLimit(PlanFragmentBuilder.java:408) at com.starrocks.sql.optimizer.operator.physical.PhysicalLimitOperator.accept(PhysicalLimitOperator.java:58) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visit(PlanFragmentBuilder.java:456) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.buildSetOperation(PlanFragmentBuilder.java:3015) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalUnion(PlanFragmentBuilder.java:3071) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalUnion(PlanFragmentBuilder.java:408) at com.starrocks.sql.optimizer.operator.physical.PhysicalUnionOperator.accept(PhysicalUnionOperator.java:69) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visit(PlanFragmentBuilder.java:456) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalCTEProduce(PlanFragmentBuilder.java:3279) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalCTEProduce(PlanFragmentBuilder.java:408) at com.starrocks.sql.optimizer.operator.physical.PhysicalCTEProduceOperator.accept(PhysicalCTEProduceOperator.java:46) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visit(PlanFragmentBuilder.java:456) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalCTEAnchor(PlanFragmentBuilder.java:3296) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visitPhysicalCTEAnchor(PlanFragmentBuilder.java:408) at com.starrocks.sql.optimizer.operator.physical.PhysicalCTEAnchorOperator.accept(PhysicalCTEAnchorOperator.java:54) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.visit(PlanFragmentBuilder.java:456) at com.starrocks.sql.plan.PlanFragmentBuilder$PhysicalPlanTranslator.translate(PlanFragmentBuilder.java:421) at com.starrocks.sql.plan.PlanFragmentBuilder.createPhysicalPlan(PlanFragmentBuilder.java:240) at com.starrocks.sql.InsertPlanner.buildExecPlan(InsertPlanner.java:527) at com.starrocks.sql.InsertPlanner.plan(InsertPlanner.java:315) at com.starrocks.sql.StatementPlanner.planInsertStmt(StatementPlanner.java:199) at com.starrocks.sql.StatementPlanner.plan(StatementPlanner.java:140) at com.starrocks.sql.StatementPlanner.plan(StatementPlanner.java:93) at com.starrocks.qe.StmtExecutor.execute(StmtExecutor.java:534) at com.starrocks.statistic.StatisticsCollectJob.collectStatisticSync(StatisticsCollectJob.java:151) at com.starrocks.statistic.SampleStatisticsCollectJob.collect(SampleStatisticsCollectJob.java:79) at com.starrocks.statistic.StatisticExecutor.collectStatistics(StatisticExecutor.java:285) at com.starrocks.statistic.StatisticAutoCollector.runAfterCatalogReady(StatisticAutoCollector.java:86) at com.starrocks.common.util.FrontendDaemon.runOneCycle(FrontendDaemon.java:72) at com.starrocks.common.util.Daemon.run(Daemon.java:107)