What was broken
Sonic is a fast search backend written in Rust, which its authors describe as an alternative to Elasticsearch that runs on a few megabytes of RAM. It keeps its index in RocksDB (the KV store) and in FST files. The TRIGGER backup command was meant to copy both, but it failed in two situations described in issue #274.
The first was a backup right after writing data with PUSH. Writing opens the RocksDB database and leaves it open in the store pool, and the backup code tried to open it a second time. RocksDB refuses that, because its LOCK file is already held. The second was a fresh server where nothing had been written yet, so the store directories did not exist at all.
What we changed
If the store is already open in the pool, the backup is taken from that instance. Before the backup the data is flushed to disk, because in-memory buffers may hold writes that are not in the files yet:
When the KV or FST store directory does not exist yet, the backup simply skips it instead of failing.
How we tested it
The trigger_backup test was previously ignored with a note that the client did not support it, and its body was todo!(). We wrote it from scratch: a backup on an empty server, then a PUSH, then a backup while the store is open, and a check that the backup directory holds exactly one non-empty KV backup.
The result
The change was merged on 5 October 2026. Our second fix (#432) was accepted the same day: since an earlier change, the loop over FST buckets checked the wrong entry, so the backup reported success without writing any FST files and a restore restored nothing.