pitr_ha_clusters
Creates, updates, deletes, gets or lists a pitr_ha_clusters resource.
Overview​
| Name | pitr_ha_clusters |
| Type | Resource |
| Id | railway.storage.pitr_ha_clusters |
Fields​
The following fields are returned by SELECT queries:
- get_replication_health
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.
| Name | Datatype | Description |
|---|---|---|
environment_id | string | |
root_service_id | string | |
all_healthy | boolean | |
checked_at | string | |
members | array | List of PitrHaMemberReplicationHealth objects |
reachable | boolean |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_replication_health | select | environment_id, root_service_id | 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. | |
disable_pitr | exec | environment_id, project_id, root_service_id | 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. | |
enable_pitr | exec | environment_id, project_id, root_service_id | Enables 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.
| Name | Datatype | Description |
|---|---|---|
environment_id | string | |
root_service_id | string | |
project_id | string | Project containing the cluster (returned in payload). |
SELECT examples​
- get_replication_health
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​
- disable_pitr
- enable_pitr
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
;
Enables 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.
EXEC railway.storage.pitr_ha_clusters.enable_pitr
@environment_id='{{ environment_id }}', --required
@project_id='{{ project_id }}', --required
@root_service_id='{{ root_service_id }}' --required
;