Persistent volume guarantees for safe SQLite restore: flock, fsync and host fencing
lorikam
FREEOP

5 hours ago

We run a single-replica Node.js application with SQLite on a Railway persistent volume mounted at /data.

We are designing an administrative restore operation that stops all database access and replaces the SQLite file under an exclusive filesystem lock.

Could you confirm:

  1. What filesystem backs persistent volumes, and what guarantees apply to flock, atomic rename and fsync? Are these guarantees preserved during volume relocation? Does flock provide mutual exclusion between different hosts that could access the same volume?
  2. During volume relocation or host failure, is the previous host prevented from writing before the volume becomes writable on another host? Can a suspended or disconnected previous host resume writes afterward?
  3. Does the documented prevention of simultaneous deployment mounts also cover infrastructure-initiated relocation and host failures?

Please provide documentation supporting these answers, especially the mechanism or guarantee that prevents the previous host from resuming writes.

We need these confirmations before enabling restore. We are not requesting infrastructure changes.

Awaiting User Response

3 Replies

Status changed to Awaiting Railway Response Railway • about 5 hours ago


Railway
BOT

4 hours ago

A volume is only ever mounted into one running container. You cannot deploy a service with a volume attached as multiple replicas, and your service is never attached to more than one copy of its volume. Since no two hosts share the same mount, flock only coordinates processes inside your container. It is not a lock between hosts.

When a volume is moved, your running deployment is stopped before the service starts using the volume in its new location. We do not publish a separate host-fencing guarantee for unplanned host failures, or specific guarantees beyond normal filesystem behavior for flock, rename and fsync. Volume backups capture the whole volume at one point in time. They do not pause your application or flush its buffers, so whether the data recovers cleanly depends on SQLite's own crash-recovery and durability settings.


Status changed to Awaiting User Response Railway • about 4 hours ago


Railway

A volume is only ever mounted into one running container. You cannot deploy a service with a volume attached as multiple replicas, and your service is never attached to more than one copy of its volume. Since no two hosts share the same mount, flock only coordinates processes inside your container. It is not a lock between hosts. When a volume is moved, your running deployment is stopped before the service starts using the volume in its new location. We do not publish a separate host-fencing guarantee for unplanned host failures, or specific guarantees beyond normal filesystem behavior for flock, rename and fsync. Volume backups capture the whole volume at one point in time. They do not pause your application or flush its buffers, so whether the data recovers cleanly depends on SQLite's own crash-recovery and durability settings.

lorikam
FREEOP

2 hours ago

Thank you. The planned-relocation explanation is helpful, but the unplanned-failure question remains unresolved. Could a Railway engineer confirm whether, after a host failure or disconnection and volume reattachment elsewhere, the previous host is prevented from resuming writes before the new host can write?

We are not asking for a cross-host flock guarantee or infrastructure changes. We need to understand whether the single-container volume guarantee also holds during unplanned failures, and whether storage fencing or another mechanism enforces it. If this is not guaranteed, please state that explicitly.

Please also identify the filesystem used for persistent volumes and any documentation covering rename/fsync durability. A human technical clarification would help us decide whether administrative SQLite restore is appropriate on this platform.


Status changed to Awaiting Railway Response Railway • about 2 hours ago


chandrika
EMPLOYEE

37 minutes ago

To answer your question directly: we do not publish a storage-fencing guarantee for unplanned host failures or disconnections. You should not assume there is a guaranteed mechanism that stops a previous host from resuming writes before the volume becomes writable somewhere else.

The guarantees we do stand behind are the ones covered earlier. A volume is attached to one running deployment of your service at a time, services with a volume can't run as multiple replicas, and a planned relocation stops your running deployment before the service uses the volume in its new location.

We also don't publish filesystem-specific guarantees for flock, rename or fsync beyond normal behavior inside your container. For an administrative SQLite restore, the safest design relies on SQLite's own journaling and synchronous settings for crash durability, not on platform-level fencing. Volume backups are point-in-time, crash-consistent snapshots of the whole volume. They don't pause your application or flush its buffers.


Status changed to Awaiting User Response chandrika • 37 minutes ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...