Skip to content

WAL disk full

The WAL holds only messages not yet uploaded to Cloud Storage and recorded in the index: normally one or two seconds’ worth. It grows only when uploads stall, because Cloud Storage, IAM or the database fails. For an outage of T seconds at R MB/s of publishes on a pod, the WAL needs about R × T MB.

  • The pending-upload cap. Once a pod has config.maxPendingUploadMb waiting for upload, it refuses publishes with UNAVAILABLE. Clients retry, and well-behaved publishers back off. The cap is set well below the disk size (Sizing), so the disk normally never fills.
  • If the disk fills anyway, a failed write or sync puts the WAL in a failed state: WAL write/fsync failed; WAL is now read-only. That pod then refuses every publish (UNAVAILABLE) until it restarts, even after space is freed. /readyz returns 503, so the pod leaves the Service, and /healthz returns 500, so the liveness probe restarts it after about a minute. lowtide_wal_failed is 1 meanwhile, and the console shows the cluster as degraded.
  • Uploads continue on their own. Files are deleted as they are recorded in the index.
  • Messages written before the failure but not acknowledged can survive in the file. Recovery keeps every intact record. A publisher that retried such a batch produces duplicates.

Messages not yet uploaded are kept in the in-memory cache only while it holds less than twice config.tailCacheMb. Beyond that, the oldest are dropped from memory and stay only on disk. So during an upload stall memory stays bounded at about twice the cache size plus delivery buffers, and the disk, through the pending-upload cap, bounds how long a pod rides it out. The cost: readers of dropped data, meaning other pods’ subscribers and local ones that lag, wait until it is uploaded. A restart replays WAL files into the cache under the same limit.

Set the memory limit to at least twice config.tailCacheMb plus room for delivery.

Search the logs for segment upload failed; retrying:

Error Cause
Cloud Storage 403 The gateway’s service account lost access to the bucket, or Workload Identity is broken.
Cloud Storage 404 The bucket name in blob.url is wrong, or the bucket was deleted.
indexing segment The database. See Metadata store outage.

Fix the cause. The uploader retries with backoff up to 10 seconds and drains the files in order.

Each *.wal file holds acknowledged messages that are not in Cloud Storage yet. Deleting one loses them.

If you need space now, expand the volume. The chart’s StorageClass allows expansion while the pod runs:

Terminal window
kubectl -n lowtide patch pvc wal-lowtide-us-central1-a-0 \
-p '{"spec":{"resources":{"requests":{"storage":"400Gi"}}}}'
kubectl -n lowtide get pvc wal-lowtide-us-central1-a-0 -w # wait for the new capacity

If the pod still sees the old size afterwards, restart it.

Then make the StatefulSet match, so new pods get the new size. Its volume template can’t be changed in place, so delete the StatefulSet object without touching its pods, then apply the new size:

Terminal window
kubectl -n lowtide delete statefulset lowtide-us-central1-a --cascade=orphan
kubectl -n lowtide delete statefulset lowtide-us-central1-b --cascade=orphan

With the Terraform module, set wal_disk_size_gb = 400 and run terraform apply. With Helm, run helm upgrade with persistence.size=400Gi. Grow every pod’s volume the same way.

Once there is space, restart the pod:

Terminal window
kubectl -n lowtide delete pod lowtide-us-central1-a-0

Recovery seals the last file and uploads everything. If the pod crash-loops with opening WAL errors, the disk is still too full to create a new file: grow it first. If it is killed for memory during recovery, raise the memory limit.