TurboPanel Docs
Database

Upgrades

Instance-wide upgrade runs and the per-server daemon and instance steps that belong to them.

Tables on this page: upgrade · upgradestep. Generated from migration 0007_add_upgrade_tables; see How to read this.

upgrade

One instance-wide upgrade run, written by the upgrade orchestrator, with at most one pending or running row.

ColumnTypeNullDefaultDescription
id (PK)uuidnouuidv7()Primary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zonenonow()Row creation time.
updated_attimestamp(3) with time zonenonow()Last write time; the ORM sets it to now() on every update.
targetjsonbyesPins for daemon, instance and ui: version, commit, build id, built-at time and pinned manifest URL; NULL until resolved.
preflightjsonbyesChecks recorded before the first dispatch: blockers, version floors and which units this run will touch.
sourcetextnoWho started the run: manual from the panel, auto from the scheduler, or server for a single-host request.
channeltextnoUpdate channel the run follows (trunk, canary, rc or release), copied from the instance when the run is created.
statustextno'pending'Lifecycle pending, running, succeeded, partially_failed, failed or cancelled; the orchestrator advances it.
phasetextyesCurrent wave colocated_daemon, control_plane or fleet; NULL until the orchestrator enters the first wave.
started_byuuidyesFK → user.id (on delete set null). User who started a manual run; NULL for an automatic run and after that account is deleted.
batch_policyjsonbyesSnapshot of upgrade settings (auto-update, batch size and maintenance window) taken when the run starts.
countsjsonbyesTerminal step totals written when the run finishes, so the summary remains after old steps are pruned.
errortextyesRun-level failure text when the status is failed or partially_failed; NULL on success.
started_attimestamp(3) with time zoneyesWhen the orchestrator moved the run from pending to running.
finished_attimestamp(3) with time zoneyesWhen the run reached a terminal status.

Constraints and indexes

  • Unique index uniq_upgrade_active: ((true)) where "upgrade"."status" IN ('pending', 'running')
  • Check upgrade_source_check: source IN ('manual', 'auto', 'server')
  • Check upgrade_status_check: status IN ('pending', 'running', 'succeeded', 'partially_failed', 'failed', 'cancelled')
  • Check upgrade_phase_check: phase IS NULL OR phase IN ('colocated_daemon', 'control_plane', 'fleet')

upgradestep

One daemon or instance install on one server inside an upgrade run, advanced by the orchestrator until a terminal outcome.

ColumnTypeNullDefaultDescription
id (PK)uuidnouuidv7()Primary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zonenonow()Row creation time.
updated_attimestamp(3) with time zonenonow()Last write time; the ORM sets it to now() on every update.
upgrade_iduuidnoFK → upgrade.id (on delete cascade).
server_iduuidnoFK → server.id (on delete cascade).
unittextnodaemon or instance: the package this step installs on its server.
batch_indexintegerno0Zero-based wave index within the run; steps that share an index are dispatched together.
statustextno'pending'pending/waiting/dispatched/preparing/downloading/installing/restarting/verifying/done/failed/rolled_back/needs_attention/skipped.
request_idtextyesCell correlation id for the in-flight install; NULL until the step is dispatched.
attemptsintegerno0Dispatch count for this step, starting at 0 and incremented before each retry.
next_attempt_attimestamp(3) with time zoneyesEarliest time a non-terminal step may be retried; NULL when no retry is scheduled.
from_versiontextyesVersion installed before this step ran; NULL when the host had none.
to_versiontextyesVersion this step installs, copied from the run target for unit.
from_committextyesCommit installed before this step ran; NULL when it was unknown.
to_committextyesCommit this step installs, copied from the run target for unit.
last_stage_attimestamp(3) with time zoneyesWhen status last changed, so a step stuck in one stage can be detected.
error_codetextyesMachine-readable code when the step fails, rolls back or needs attention.
error_messagetextyesHuman-readable failure text set alongside error_code.
detailjsonbyesSmall stage facts such as bytes fetched or an exit code; the orchestrator writes it, never a transcript.

Constraints and indexes

  • Index idx_upgradestep_upgrade_status: (upgrade_id, status)
  • Index idx_upgradestep_server_created: (server_id, created_at)
  • Index idx_upgradestep_active_next_attempt: (status, next_attempt_at) where "upgradestep"."status" IN ('pending', 'waiting', 'dispatched', 'preparing', 'downloading', 'installing', 'restarting', 'verifying')
  • Check upgradestep_unit_check: unit IN ('daemon', 'instance')
  • Check upgradestep_status_check: status IN ('pending', 'waiting', 'dispatched', 'preparing', 'downloading', 'installing', 'restarting', 'verifying', 'done', 'failed', 'rolled_back', 'needs_attention', 'skipped')
Edit on GitHub

Last updated on

On this page