Skip to main content

pitr_ha_clusters

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

Overview​

Namepitr_ha_clusters
TypeResource
Idrailway.storage.pitr_ha_clusters

Fields​

The following fields are returned by SELECT queries:

One PitrHaClusterReplicationHealth row. Live replication health of an HA database cluster's members. Used to gate the Enable/Disable PITR buttons on the same 'caught up' definition the rollout enforces.

NameDatatypeDescription
environment_idstring
root_service_idstring
all_healthyboolean
checked_atstring
membersarrayList of PitrHaMemberReplicationHealth objects
reachableboolean

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_replication_healthselectenvironment_id, root_service_idLive replication health for an HA database cluster (Postgres HA, MySQL HA). Use it to gate the Enable/Disable PITR buttons so a rollout can't start while a member is too far behind to rejoin. Returns null when the service isn't an HA root. Backed by the Railway GraphQL query pitrHaClusterReplicationHealth.
disable_pitrexecenvironment_id, project_id, root_service_idDisables point-in-time recovery on an HA database cluster with the same rolling rollout as enable. The backup bucket is left intact, so existing backup history is preserved. Backed by the Railway GraphQL mutation disablePitrForHaCluster.
enable_pitrexecenvironment_id, project_id, root_service_idEnables point-in-time recovery on an HA database cluster (Postgres HA, MySQL HA) with a rolling, near-zero-downtime rollout across its members. Safe to retry. Backed by the Railway GraphQL mutation enablePitrForHaCluster.

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
project_idstringProject containing the cluster (returned in payload).

SELECT examples​

Live replication health for an HA database cluster (Postgres HA, MySQL HA). Use it to gate the Enable/Disable PITR buttons so a rollout can't start while a member is too far behind to rejoin. Returns null when the service isn't an HA root. Backed by the Railway GraphQL query pitrHaClusterReplicationHealth.

SELECT
environment_id,
root_service_id,
all_healthy,
checked_at,
members,
reachable
FROM railway.storage.pitr_ha_clusters
WHERE environment_id = '{{ environment_id }}' -- required
AND root_service_id = '{{ root_service_id }}' -- required
;

Lifecycle Methods​

Disables point-in-time recovery on an HA database cluster with the same rolling rollout as enable. The backup bucket is left intact, so existing backup history is preserved. Backed by the Railway GraphQL mutation disablePitrForHaCluster.

EXEC railway.storage.pitr_ha_clusters.disable_pitr
@environment_id='{{ environment_id }}', --required
@project_id='{{ project_id }}', --required
@root_service_id='{{ root_service_id }}' --required
;