为了更快的定位您的问题,请提供以下信息,谢谢
【详述】
CREATE MATERIALIZED VIEW mv_pig_dd_user_dept_info_daily
– DISTRIBUTED BY HASH(stat_date
) 这个加不加都会出现问题
REFRESH ASYNC START(“2025-01-16 12:05:00”) EVERY(INTERVAL 10 MINUTE)
AS SELECT COUNT(DISTINCT did
.user_id
) AS User_Count
, DATE_FORMAT(did
.stat_date
, ‘%Y-%m’) AS stat_date
, did
.dept_id
FROM tidb
.mbg_core
.pig_dd_user_dept_info_daily
AS did
GROUP BY did
.dept_id
, DATE_FORMAT(did
.stat_date
, ‘%Y-%m’);
– 这样不做日期处理也不行
CREATE MATERIALIZED VIEW mv_pig_dd_user_dept_info_daily1
REFRESH ASYNC START(“2025-01-20 16:05:00”) EVERY(INTERVAL 10 MINUTE)
AS SELECT COUNT(DISTINCT did
.user_id
) AS User_Count
,did.stat_date
AS stat_date
, did
.dept_id
FROM tidb
.mbg_core
.pig_dd_user_dept_info_daily
AS did
GROUP BY did
.dept_id
, stat_date
;
CREATE TABLE pig_dd_user_dept_info_daily
(
id
bigint(20) NOT NULL AUTO_INCREMENT,
stat_date
varchar(255) NOT NULL COMMENT ‘日期’,
dept_id
bigint(20) NOT NULL COMMENT ‘钉钉部门ID’,
user_id
varchar(255) NOT NULL COMMENT ‘钉钉用户ID’,
user_name
varchar(150) DEFAULT NULL COMMENT ‘钉钉用户姓名’,
dept_name
varchar(150) DEFAULT NULL COMMENT ‘钉钉部门名称’,
parent_dept_id
mediumtext DEFAULT NULL COMMENT ‘父级部门id串,英文逗号拼接’,
parent_dept_name
mediumtext DEFAULT NULL COMMENT ‘父级部门名称串,英文逗号拼接’,
create_time
datetime DEFAULT CURRENT_TIMESTAMP COMMENT ‘创建时间’,
update_time
timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘修改时间’,
full_dept_id
mediumtext DEFAULT NULL COMMENT ‘用户所属 所有部门id /拼接,层级由高到低’,
full_dept_name
mediumtext DEFAULT NULL COMMENT ‘用户所属 所有部门名称 /拼接,层级由高到低’,
belong_dept_id
bigint(20) DEFAULT NULL COMMENT ‘所属新的目前存在的父部门ID’,
new_dept_id
bigint(20) DEFAULT NULL COMMENT ‘本记录中的dept_id相当于现在的 - 新的存在的部门ID’,
PRIMARY KEY (id
,stat_date
) /*T![clustered_index] NONCLUSTERED */,
UNIQUE KEY uq_sdu
(stat_date
,dept_id
,user_id
),
KEY idx_dept_id
(dept_id
),
KEY idx_user_id
(user_id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=26880689 COMMENT=‘钉钉用户主部门天表’
PARTITION BY RANGE COLUMNS(stat_date
)
(PARTITION p2023
VALUES LESS THAN (‘2024-01-01’),
PARTITION p2024
VALUES LESS THAN (‘2025-01-01’),
PARTITION p202501
VALUES LESS THAN (‘2025-02-01’),
PARTITION p202502
VALUES LESS THAN (‘2025-03-01’))
【背景】
Refresh materialized view mv_pig_dd_user_dept_info_daily failed after retrying 1 times(try-lock 0 times), error-msg : java.lang.IllegalStateException: corrupted partition meta
at com.google.common.base.Preconditions.checkState(Preconditions.java:512)
at com.starrocks.connector.partitiontraits.DefaultTraits.getPartitionNameWithPartitionInfo(DefaultTraits.java:117)
at com.starrocks.connector.partitiontraits.DefaultTraits.getUpdatedPartitionNames(DefaultTraits.java:134)
at com.starrocks.connector.partitiontraits.CachedPartitionTraits.lambda$getUpdatedPartitionNames$13(CachedPartitionTraits.java:184)
at com.starrocks.connector.partitiontraits.CachedPartitionTraits.lambda$getCache$0(CachedPartitionTraits.java:89)
at com.github.benmanes.caffeine.cache.LocalCache.lambda$statsAware$0(LocalCache.java:139)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2406)
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1908)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2404)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2387)
at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108)
at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
at com.starrocks.connector.partitiontraits.CachedPartitionTraits.getCache(CachedPartitionTraits.java:89)
at com.starrocks.connector.partitiontraits.CachedPartitionTraits.getUpdatedPartitionNames(CachedPartitionTraits.java:184)
at com.starrocks.catalog.MaterializedView.getUpdatedPartitionNamesOfExternalTable(MaterializedView.java:828)
at com.starrocks.catalog.MvRefreshArbiter.needsToRefreshTable(MvRefreshArbiter.java:145)
at com.starrocks.catalog.MvRefreshArbiter.needsToRefreshTable(MvRefreshArbiter.java:47)
at com.starrocks.scheduler.mv.MVPCTRefreshPartitioner.isNonPartitionedMVNeedToRefresh(MVPCTRefreshPartitioner.java:246)
at com.starrocks.scheduler.mv.MVPCTRefreshNonPartitioner.getMVPartitionsToRefresh(MVPCTRefreshNonPartitioner.java:66)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.getPartitionsToRefreshForMaterializedView(PartitionBasedMvRefreshProcessor.java:972)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.getPartitionsToRefreshForMaterializedView(PartitionBasedMvRefreshProcessor.java:930)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.checkMvToRefreshedPartitions(PartitionBasedMvRefreshProcessor.java:289)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doRefreshMaterializedView(PartitionBasedMvRefreshProcessor.java:439)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doRefreshMaterializedViewWithRetry(PartitionBasedMvRefreshProcessor.java:368)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doMvRefresh(PartitionBasedMvRefreshProcessor.java:327)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.processTaskRun(PartitionBasedMvRefreshProcessor.java:199)
at com.starrocks.scheduler.TaskRun.executeTaskRun(TaskRun.java:270)
at com.starrocks.scheduler.TaskRunExecutor.lambda$executeTaskRun$0(TaskRunExecutor.java:59)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
【业务影响】
【是否存算分离】
【StarRocks版本】3.3
【集群规模】例如:3fe(1 follower+2observer)+3be(fe与be混部)
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
【联系方式】为了在解决问题过程中能及时联系到您获取一些日志信息,请补充下您的联系方式,例如:社区群4-何明或者邮箱 heming@emar.com
【附件】
另外今天中午有个大的物化视图强制刷新 force 之后 所有be节点产生 coredump 。
[root@049 ccpp-2025-01-20-11:23:24-251273.new]# more cmdline
/data/starRocks/be/lib/starrocks_be