Skip to content

bottomless-cli: ls -v finds zstd snapshots (HeadObject); restore into sqld's namespace directory - #2342

Open
jrparks wants to merge 7 commits into
tursodatabase:mainfrom
jrparks:up/bottomless-cli-fixes
Open

jrparks wants to merge 7 commits into
tursodatabase:mainfrom
jrparks:up/bottomless-cli-fixes

Conversation

@jrparks

@jrparks jrparks commented Dec 1, 2026

Copy link
Copy Markdown

Two small fixes to bottomless-cli, one commit each.

ls -v (first commit). print_snapshot_summary looked only for db.gz, but the snapshot is db.<compression>: zstd by default (also gz, raw), so zstd snapshots were reported as missing. It also called GetObjectAttributes, which several S3-compatible stores (for example OCI Object Storage) do not implement; they answer with a generic service error. It now probes db.zstd, db.gz, db.raw (the order restore uses) with HeadObject, which every S3 implementation supports, and prints which one it found.

Restore path (second commit). sqld's bottomless id is ns-<db id>:<namespace> (ns-:default with no db id) and the namespace database is <db path>/dbs/<namespace>/data. The CLI used everything after ns- as the directory name, so -n ns-:default -d my.db restored to my.db/dbs/:default/data, which sqld never reads. It now uses the part after the last :; the older ns-<namespace> form keeps working.

Tested against a local S3 (s3s-fs) with sqld bottomless uploads: restoring an older generation lands in my.db/dbs/default/data, holds only that generation's rows, and sqld started with bottomless on it keeps them.

The branch sits on top of the two CI commits from #2317 (ubuntu-24.04 pin) so the Extensions and Go checks can run; those commits drop out once #2317 merges. cargo check -p bottomless-cli passes.

ubuntu-latest moved to Ubuntu 26.04 between 2026-11-08 and 2026-11-11.
On 26.04 these jobs fail before reaching any test: CMake 4 rejects
wabt-sys 0.6.1 (cmake_minimum_required < 3.5) and the sqlite3_capi
bindings come out empty. The same jobs pass on 24.04, which every
green run so far used. Pinning restores CI for open PRs until the
toolchain issues are fixed properly.

Refs tursodatabase#2315
Go 1.27.4 refuses to link libsql_experimental.a: "disallowed LTO section
".llvmbc" in #cgo LDFLAGS". setup-go '>=1.21' picked 1.27.4 on the
first run of this PR; the last green run used 1.27.3. Pin until the
static library is built without embedded bitcode.

Refs tursodatabase#2315
print_snapshot_summary looked only for db.gz, but the snapshot is
db.<compression>: zstd by default (also gz, raw), so zstd snapshots were
never found. It also used GetObjectAttributes, which S3-compatible stores
such as OCI Object Storage do not implement (generic 'service error').

Probe db.zstd, db.gz, db.raw (restore's order) with HeadObject, which every
S3 implementation supports, and print which one was found.
sqld's bottomless id is ns-<db id>:<namespace> (ns-:default with no db id)
and the namespace database is <db path>/dbs/<namespace>/data. The CLI took
everything after ns- as the directory name, so '-n ns-:default -d my.db'
restored to my.db/dbs/:default/data, which sqld never reads. Use the part
after the last ':' (older ns-<namespace> ids still work).

Tested against a local S3 (s3s-fs) with sqld bottomless uploads: restore of
an older generation lands in my.db/dbs/default/data, holds only that
generation's rows, and sqld started with bottomless on it keeps them.
@jrparks

jrparks commented Dec 1, 2026

Copy link
Copy Markdown
Author

The only failing check is golang-bindings: TestConcurrentOnSingleConnection hangs until Go's 10-minute timeout. That job runs go-libsql's main against the published libsql-server:latest image, so it doesn't exercise this diff (only bottomless-cli changed). It is intermittent: the same job passed on this PR's previous push and on #2343 and #2344, and hung once on each of those as well. Could a maintainer re-run golang-bindings? I can't re-run single jobs from a fork.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant