DEV Community

Cover image for The healthy database that starved: how overlapping backup retries ate Wayscloud's memory
Kashif Manzer
Kashif Manzer

Posted on Edited on

The healthy database that starved: how overlapping backup retries ate Wayscloud's memory

At 12:36 on Friday 21 November 2026, Wayscloud's availability probe got no answer from one of its database hosts and paged the team.

The database engine itself was healthy. It had not crashed. It had not stopped. For roughly 22 minutes, from about 12:30 to 12:52, it was severely short of memory, so connections were still served but slowly, and probes timed out.

The strange part is what happened before that page. For about 24 hours, the database had been answering queries normally while its off-site backup copy quietly fell behind. Nobody was told, because the message that would have told them needed the same broken path as the backup.

Then the backup job, trying again and again with nothing to stop its runs overlapping, used up the memory the healthy database needed.

Two small missing guards. One silent day. One starved database.

First, the plain words

A transaction log is the database's running diary of changes. Each change is written there in order. If you keep the log segments, you can rebuild the database to a chosen moment. That rebuild is called point-in-time recovery.

An archive job is a scheduled task that copies those log segments somewhere safe. Here it copied an encrypted archive off-site, away from the database host.

Name resolution is the host's way of turning a name into a network address. When a program needs to reach a storage endpoint, it first asks: where is that name? If the lookup fails, the program cannot even start the connection. This failure was local to one host. Customer DNS records and Wayscloud's authoritative DNS were not affected.

An availability probe is a small outside check that asks the database: are you there? If there is no answer, it pages a human.

Keep those four ideas and the rest of this story is simple.

What happened, in order

On 20 November at 12:26 CET, during routine maintenance by Wayscloud's own staff, a configuration change was applied more broadly than intended on one database host. Wayscloud's report, WAYSCLOUD-TR-2026-0032, says the change restricted access to a shared system location the host's services depend on. The report does not name the file, the internal service, or the database engine, so this article does not guess them.

From 12:30, name lookups on that host failed.

That one fault broke two things at once.

First, the archive job could no longer reach the storage endpoint, so every attempt to copy the transaction-log archive off-site failed.

Second, the host could no longer report its backup status to the platform. So the degradation did not reach Wayscloud. The database continued to serve queries normally, and from the outside the host looked fine.

Local archiving kept working, so point-in-time recovery from the host itself was never at risk. The off-site copy fell up to 24 hours behind. Independent platform-level backups also completed on schedule throughout, so another recovery path stayed available.

During the night, with memory pressure already rising during routine backup activity, the failing upload processes accumulated. The job had no protection against overlapping runs. A new run could start while an earlier run was still hanging around, and then another, and another.

The host ran short of memory. The database engine, still healthy in itself, was starved of the resources it needed. At 12:36 on 21 November the availability probe received no response and paged.

The fix, and what did not happen

Remediation was direct. The accumulated processes were stopped. The job was halted and given overlap protection, a lock so a run can never overlap the previous one. The configuration was corrected.

Name resolution returned at 12:52 and the affected internal service recovered on its own, without restarting the database engine. Wayscloud verified one off-site upload end to end with a real segment before resuming the schedule, then drained the backlog. The full backlog was copied by 15:20 the same day. A long-running internal query that was adding to the memory pressure was also terminated.

Internal TLS certificates scheduled for renewal overnight could not be issued while name resolution was unavailable. They were renewed after recovery. No certificate expired.

Just as important is what did not happen. No data was lost or modified. The engine never stopped, so no restore was needed. There was no unauthorised access and no external cause. Applications connected during the starved window may have seen higher latency and individual connection timeouts, but connections were still served. This was not a DNS-wide failure and not a full database outage.

Wayscloud names five preventive measures. Two matter most for the rest of us.

Availability monitoring previously tested only the database port. A direct check for name resolution on database hosts has now been added, alongside a wider monitoring rollout.

And alerting independence. The backup alert did not reach the team because the reporting path depended on the affected host. That dependency has been removed. Wayscloud calls it the most serious finding of the incident. The other measures are change auditing of critical system configuration, a runbook correction so credential restrictions are applied to the specific credential artefact and never to a shared system location, and a review of memory limits and the database connection ceiling.

Why this is not the last two stories again

If you read the Inngest piece from 4 November, that was a request-path connection pool collapsing under timeouts. The ElevenLabs piece from 25 November was cache rebuilds and unbounded connections after restarts.

This one is different. The pressure came from a scheduled background job overlapping itself, plus a self-reporting blind spot. The database did not fail. Its helper did, quietly, and then loudly.

Guard one: one run at a time

A scheduled job that can overlap itself will eventually overlap itself, usually on the worst night, when the thing it depends on is already broken and each run takes longer than the gap between runs.

The smallest useful guard is a single-instance lock. The job takes a lock on a file at start. If another run already holds it, the new run exits quietly. The operating system releases the lock if the process crashes, so a dead run does not block the next one forever.

In Go, using a non-blocking exclusive flock:

package main

import (
    "fmt"
    "os"
    "syscall"
)

func main() {
    lockFile, err := os.OpenFile("/tmp/archive-job.lock", os.O_CREATE|os.O_RDWR, 0644)
    if err != nil {
        fmt.Println("cannot open lock file:", err)
        os.Exit(1)
    }
    defer lockFile.Close()

    err = syscall.Flock(int(lockFile.Fd()), syscall.LOCK_EX|syscall.LOCK_NB)
    if err != nil {
        fmt.Println("another run is already in progress, exiting")
        return
    }
    defer syscall.Flock(int(lockFile.Fd()), syscall.LOCK_UN)

    // Do the archive work here. Only one run reaches this point.
    fmt.Println("running archive job")
}
Enter fullscreen mode Exit fullscreen mode

The same shape in Python:

import fcntl
import sys

lock_path = "/tmp/archive-job.lock"
lock_file = open(lock_path, "w")

try:
    fcntl.flock(lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB)
except BlockingIOError:
    print("another run is already in progress, exiting")
    sys.exit(0)

# Do the archive work here. Only one run reaches this point.
print("running archive job")
Enter fullscreen mode Exit fullscreen mode

Test the boundary, not just the happy path. With no run in progress, the job starts. With one run in progress, a second run exits at once. After a crashed run, the next run starts again, because the operating system has released the flock. Those three cases are the whole guard.

A lock alone does not fix a job that fails every time. It stops the pile-up. You still need the second guard to hear about the failure.

Guard two: an alarm that does not need the sick host

The Wayscloud backup alert travelled over the same broken path as the backup. When name resolution failed, both the copy and the report failed, and silence looked like health.

A dead-man's switch flips the direction. The job sends a small ping to an external service only when it succeeds. The external service watches for that ping. If the ping stops arriving, the external service alerts, without the host sending anything at all.

The shape is small. On success, ping. On failure, do nothing, and let the absence speak.

import urllib.request

def ping_success(url: str) -> None:
    try:
        urllib.request.urlopen(url, timeout=5)
    except Exception:
        # A failed ping must not crash the job.
        # The external watcher will alert on the missing ping.
        pass

# After a successful archive run only:
# ping_success("https://your-watcher.example/ping/archive-job")
Enter fullscreen mode Exit fullscreen mode

Two tests matter. When the success ping arrives on schedule, no alert fires. When the ping stops, because the job failed, hung, or the host lost name resolution, the alert fires anyway. That second test is the point. The alert path must not depend on the host's own DNS or reporting.

Wayscloud's own fix points the same way: a direct name-resolution check on database hosts, and alerting that no longer depends on the affected host. You do not need their exact platform to copy the idea. You need one check that runs from somewhere else, and one signal whose absence means trouble.

If you have room for a third guard, bound the retries. Give the job a limit on attempts, a pause that grows between them, and a memory cap, so a failing job cannot accumulate without limit while it waits to be noticed.

What to take away

The database was fine. That is what makes this incident worth remembering. A healthy engine served queries for about 24 hours while its off-site copy fell behind, because the alarm needed the same road as the backup. Then overlapping retries took the memory the healthy engine needed, and only then did a probe notice.

Before your next scheduled job ships, ask three plain questions. Can two runs overlap? If this job fails silently for a day, who hears about it, and does that message need the same host to be healthy? And if every run hangs, what stops the pile from eating the machine?

Wayscloud's report is short and unusually honest about the blind spot. It is worth reading in full.

Does your backup job report its own failures, or does something outside the host notice when the success signal goes quiet?

Sources: Wayscloud Trust Center, WAYSCLOUD-TR-2026-0032, "Database availability incident 20-21 November", published 21 November 2026. All times are CET as given in the report, except the publish time which is UTC. The report does not name the database engine, the internal service, or the shared system location, so this article does not name them either. The Go and Python snippets show the shape of the guards, not Wayscloud source code.

Top comments (0)