Hi Flink 社区: 我们的Flink版本是1.9.2,用的是blink planer,我们今天遇到一个问题,目前没有定位到原因,现象如下: 手动重启任务时,指定了从一个固定的checkpoint恢复时,有一定的概率,一部分状态数据无法正常恢复,启动后Flink任务本身可以正常运行,且日志中没有明显的报错信息。 具体现象是:type=realshow的数据没有从状态恢复,也就是从0开始累加,而type=show和type=click的数据是正常从状态恢复的。
SQL大致如下: createview view1 as select event_id, act_time, device_id from table1 where getStringFromJson
(act_argv
, 'ispin', '') <>'1' and event_id in ('article_newest_list_show','article_newest_list_sight_show', 'article_list_item_click', 'article_auto_video_play_click');
--天的数据 insertinto table2 select platform, type, time
, count(1) as pv, hll_uv(device_id) as uv from (select'03'as platform, trim(casewhen event_id ='article_newest_list_show'then'show' when event_id ='article_newest_list_sight_show'then'realshow' when event_id ='article_list_item_click'then'click'else''end) astype, date_parse
(act_time
, 'yyyy-MM-dd HH:mm:ss', 'yyyyMMdd') as time
, device_id from view1 where event_id in ('article_newest_list_show','article_newest_list_sight_show', 'article_list_item_click') unionall select'03'as platform, 'click_total'astype, date_parse
(act_time
, 'yyyy-MM-dd HH:mm:ss', 'yyyyMMdd') as time
, device_id from view1 where event_id in ('article_list_item_click', 'article_auto_video_play_click'))a groupby platform, type, time
;
期待大家的帮助与回复,希望能给些问题排查的思路!*来自志愿者整理的flink邮件归档
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
面对您描述的Flink任务在特定条件下恢复时部分状态数据未能正常加载的问题,这里有几个可能的排查方向和建议:
Checkpoint一致性检查:
状态后端检查:
SQL逻辑分析:
type=realshow
的数据是从特定事件(article_newest_list_sight_show
)转换而来。考虑检查这部分数据在生成checkpoint时是否存在特殊字符、空值或其他可能导致数据处理异常的情况。getStringFromJson
和hll_uv
,这些自定义或复杂函数是否有可能在某些情况下返回意料之外的结果,影响到状态的存储或恢复。并行度变化:
日志深入分析:
测试与隔离:
社区与技术支持:
希望上述建议能帮助您定位并解决遇到的问题。如果问题依旧,进一步的技术支持和社区资源将是重要的下一步。