首页  

temporal 任务运行机制实例测试     所属分类 temporal 浏览量 647
通过一个  WorkflowType 错误 的例子,后台一直重试直到超时
webUI的数据和 数据库的数据结合起来


export NAMESPACE=bench
export TEMPORAL_CLI_NAMESPACE=bench

echo $NAMESPACE
echo $TEMPORAL_CLI_NAMESPACE

./tctl wf start --tq temporal-bench --wt bench-workflow-not-exist --wtt 5 --et 300 --if ./scenarios/basic-test.json --wid wfid0303001


--wt   WorkflowType (WorkflowName)
--wtt  WorkflowTaskTimeout  秒 
--et   WorkflowExecutionTimeout    秒

WARN	internal/internal_task_pollers.go:310	Failed to process workflow task.	
{"Namespace": "bench", "TaskQueue": "temporal-bench", "WorkerID": "9812@ecs-zhongjianjiandev@", "WorkflowType": "bench-workflow-not-exist", "WorkflowID": "wfid0303001", "RunID": "f24463c8-ffb9-43ae-a4a0-af7436e9fcf1", "Attempt": 7, "Error": "unable to find workflow type: bench-workflow-not-exist. Supported types: [bench-workflow]"}
unable to find workflow type: bench-workflow-not-exist. Supported types: [bench-workflow]
Attempt : 7  重试次数 7 会一直重试  直到超时  --et   WorkflowExecutionTimeout
executions 表里 db_record_version 字段  记录的应该就是 重试次数 或者 更新次数

temporal库
current_executions
executions

temporal_visibility库
executions_visibility

这3张表 通过 workflow_id 关联


select * from current_executions where workflow_id='wfid0303001'
select * from executions where workflow_id='wfid0303001'

select * from executions_visibility where workflow_id='wfid0303001'

WorkflowExecutionTimeout 设置了 300s 5分钟
重试直到5分钟超时 ,最后任务 超时 结束 
webUI 里 STATUS 为 Timedout



webUI 会展示一些关键信息 /namespaces/bench/workflows/wfid0303001/f24463c8-ffb9-43ae-a4a0-af7436e9fcf1/summary 工作流详情 SUMMARY HISTORY QUERY STACKTRACE SUMMARY页 WORKFLOW NAME bench-workflow-not-exist STARTED AT Thursday March 3rd, 9:07:40 am CLOSED TIME Thursday March 3rd, 9:12:40 am STATUS Timedout WORKFLOW ID wfid0303001 RUN ID f24463c8-ffb9-43ae-a4a0-af7436e9fcf1 TASK QUEUE temporal-bench HISTORY EVENTS 5 STATE TRANSITIONS 123 查看 TASK QUEUE 信息 /namespaces/bench/task-queues/temporal-bench Pollers HISTORY EVENTS 历史事件数 HISTORY grid 模式 可以查看 工作流参数信息 各种事件 WorkflowExecutionStarted WorkflowTaskScheduled WorkflowTaskStarted WorkflowTaskFailed WorkflowExecutionTimedOut
一些问题 相同的字段在不同的表中类型不一样 namespace_id run_id executions_visibility 中用的char (这个符合常理) executions 和 current_executions 中用 BYTEA ( 类似BLOB 大字段) CREATE TABLE executions_visibility ( namespace_id CHAR(64) NOT NULL, run_id CHAR(64) NOT NULL, CREATE TABLE current_executions( shard_id INTEGER NOT NULL, namespace_id BYTEA NOT NULL, workflow_id VARCHAR(255) NOT NULL, CREATE TABLE executions( shard_id INTEGER NOT NULL, namespace_id BYTEA NOT NULL, workflow_id VARCHAR(255) NOT NULL, run_id BYTEA NOT NULL, bytea类型是PostgreSQL特有的存储二进制数据的字段类型,对应 SQL标准中的BLOB和BINARY LARGE OBJECT类型 感觉 namespace_id 使用 字符串就行 MySQL 用 BINARY(16) CREATE TABLE executions( shard_id INT NOT NULL, namespace_id BINARY(16) NOT NULL, workflow_id VARCHAR(255) NOT NULL,

上一篇     下一篇
vscode 搭建go开发环境

MAC wifi 重新输入密码连接

go httpFileServer

GO获取环境变量

GO入门指南实例

temporal压测方案及记录