Giao diện
platform_events / job
Trang sinh tự động
Sinh từ ad83b0aea — chạy 820 migration lên PostgreSQL 17 rồi đọc pg_catalog. Mô tả bảng và cột lấy từ COMMENT ON. Không sửa tay: lần chạy docgen sau sẽ ghi đè.
2 bảng. Quay lại platform_events.
job_runs
P1-16. One run per (job, VN slot/period or domain key) with lease, attempts, backoff, DEAD and an observable UNKNOWN; transitions guarded by trigger and logged to job_run_events. SYSTEM_ONLY.
public.job_runs · 18 cột · 14 check · 1 unique · 4 index · 3 policy · 4 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
run_id | uuid | NOT NULL | PK | |
job_name | text | NOT NULL | ||
slot_key | text | NOT NULL | ||
scheduled_at | timestamptz | NOT NULL | ||
correlation_id | correlation_ref | NOT NULL | ||
status | text | NOT NULL | ||
attempts | integer | NOT NULL | ||
available_at | timestamptz | NOT NULL | ||
lease_owner | text | |||
lease_expires_at | timestamptz | |||
last_error_code | text | |||
finished_at | timestamptz | |||
replay_count | integer | NOT NULL | ||
replayed_by | uuid | |||
replay_reason | text | |||
version | integer | NOT NULL | ||
created_at | timestamptz | NOT NULL | ||
updated_at | timestamptz | NOT NULL |
Khoá chính: run_id
Trỏ ra: không có
Được trỏ tới (1): job_run_events
job_run_events
P1-16. Immutable history of every job_runs transition (who leased, outcome codes, replays with actor and reason). Written by trigger only. Retention GAP-EVT-RETENTION. SYSTEM_ONLY.
public.job_run_events · 11 cột · 2 check · 0 unique · 2 index · 2 policy · 2 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | bigint | NOT NULL | PK | |
run_id | uuid | NOT NULL | FK → job_runs | |
kind | text | NOT NULL | ||
from_status | text | |||
to_status | text | NOT NULL | ||
attempts | integer | NOT NULL | ||
worker | text | |||
error_code | text | |||
actor_id | uuid | |||
reason | text | |||
recorded_at | timestamptz | NOT NULL |
Khoá chính: id
Trỏ ra (1):
run_id→job_runs·ON DELETE RESTRICT
Được trỏ tới: không có