Skip to main content

pitr_ha_workflows

Creates, updates, deletes, gets or lists a pitr_ha_workflows resource.

Overview​

Namepitr_ha_workflows
TypeResource
Idrailway.storage.pitr_ha_workflows

Fields​

The following fields are returned by SELECT queries:

One PitrHaWorkflowProgress row. Progress of an in-flight or recently completed PITR enable/disable rollout on an HA database cluster.

NameDatatypeDescription
current_member_service_idstring
environment_idstring
new_leader_service_idstring
project_idstring
root_service_idstring
workflow_idstring
cluster_mutatedboolean
completed_atstring
directionstring (DISABLE, ENABLE)
enginestring
error_messagestring
failed_at_phasestring (CREATING_BUCKET, DONE, FAILED, PATCHING_DCS, PLANNING, REMOVING_VARIABLES, ROLLING_EX_LEADER, ROLLING_REPLICAS, SWITCHING_OVER, VERIFYING, WRITING_VARIABLES)
membersarrayList of PitrHaWorkflowMemberProgress objects
phasestring (CREATING_BUCKET, DONE, FAILED, PATCHING_DCS, PLANNING, REMOVING_VARIABLES, ROLLING_EX_LEADER, ROLLING_REPLICAS, SWITCHING_OVER, VERIFYING, WRITING_VARIABLES)
started_atstring
updated_atstring

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_progressselectenvironment_id, root_service_idOne-shot read of the current progress of a PITR enable/disable rollout on an HA database cluster. Use it to rehydrate state on page load, then poll this field for updates. Returns null when no rollout has run recently. Backed by the Railway GraphQL query pitrHaWorkflowProgress.
cancelexecenvironment_id, root_service_idCancels an in-progress PITR enable/disable rollout on an HA database cluster and resets its progress so the UI re-reads from the live cluster. No-ops when nothing is running. Backed by the Railway GraphQL mutation cancelPitrHaWorkflow.
clear_progressexecenvironment_id, root_service_idClears the recorded progress of a finished PITR enable/disable rollout so the Backups page starts fresh. A rollout still in progress cannot be cleared. Backed by the Railway GraphQL mutation clearPitrHaWorkflowProgress.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
environment_idstring
root_service_idstring

SELECT examples​

One-shot read of the current progress of a PITR enable/disable rollout on an HA database cluster. Use it to rehydrate state on page load, then poll this field for updates. Returns null when no rollout has run recently. Backed by the Railway GraphQL query pitrHaWorkflowProgress.

SELECT
current_member_service_id,
environment_id,
new_leader_service_id,
project_id,
root_service_id,
workflow_id,
cluster_mutated,
completed_at,
direction,
engine,
error_message,
failed_at_phase,
members,
phase,
started_at,
updated_at
FROM railway.storage.pitr_ha_workflows
WHERE environment_id = '{{ environment_id }}' -- required
AND root_service_id = '{{ root_service_id }}' -- required
;

Lifecycle Methods​

Cancels an in-progress PITR enable/disable rollout on an HA database cluster and resets its progress so the UI re-reads from the live cluster. No-ops when nothing is running. Backed by the Railway GraphQL mutation cancelPitrHaWorkflow.

EXEC railway.storage.pitr_ha_workflows.cancel
@environment_id='{{ environment_id }}', --required
@root_service_id='{{ root_service_id }}' --required
;