Skip to content

backup: add storage interface and fs/s3 impl#1308

Merged
bigbes merged 2 commits into
masterfrom
g.rybakov/tntp-8210-s3-fs
Jul 6, 2026
Merged

backup: add storage interface and fs/s3 impl#1308
bigbes merged 2 commits into
masterfrom
g.rybakov/tntp-8210-s3-fs

Conversation

@sssciel

@sssciel sssciel commented Jun 23, 2026

Copy link
Copy Markdown
Member

Implement local filesystem and S3-compatible backends.

Closes TNTP-8210

@sssciel sssciel requested review from bigbes, Copilot and patapenka-alexey and removed request for Copilot June 23, 2026 08:57
@sssciel sssciel force-pushed the g.rybakov/tntp-8210-s3-fs branch 2 times, most recently from 9c1618d to 6f17b04 Compare June 23, 2026 09:29
@sssciel sssciel force-pushed the g.rybakov/tntp-8210-s3-fs branch 3 times, most recently from 9d52d93 to 95376cf Compare June 23, 2026 11:01
@sssciel sssciel force-pushed the g.rybakov/tntp-8208-backup branch from 261879e to 32f5f15 Compare June 23, 2026 12:24
@sssciel sssciel force-pushed the g.rybakov/tntp-8210-s3-fs branch 3 times, most recently from bb6fc6d to fd06180 Compare June 29, 2026 12:02
@sssciel sssciel force-pushed the g.rybakov/tntp-8208-backup branch from 32f5f15 to d47350d Compare June 29, 2026 12:06
@patapenka-alexey

Copy link
Copy Markdown
Contributor

Please, fix static-code-check.

Base automatically changed from g.rybakov/tntp-8208-backup to master June 30, 2026 10:02
@sssciel sssciel force-pushed the g.rybakov/tntp-8210-s3-fs branch 2 times, most recently from 2010f13 to 09473ad Compare June 30, 2026 10:55
Comment thread lib/backup/storage/s3/s3.go
Comment thread lib/backup/storage/s3/s3.go Outdated
Comment thread lib/backup/storage/fs/fs.go Outdated
Comment thread lib/backup/storage/fs/fs.go Outdated
Comment thread lib/backup/storage/fs/fs.go Outdated
@sssciel sssciel force-pushed the g.rybakov/tntp-8210-s3-fs branch from 09473ad to 653d9c1 Compare July 2, 2026 15:32
@sssciel sssciel requested a review from bigbes July 2, 2026 17:24
@bigbes bigbes force-pushed the g.rybakov/tntp-8210-s3-fs branch 2 times, most recently from 890d29b to a669188 Compare July 6, 2026 13:29
Implement local filesystem and S3-compatible backends.

Closes TNTP-8210
Address review findings on the new lib/backup/storage backends:

- s3: distinguish a missing key from a missing bucket. isKeyNotFound
  now matches only NoSuchKey, not any 404 (a missing bucket returns
  404 as NoSuchBucket). Get also probes the object with a one-byte
  read (GET) rather than Stat (HEAD): a GET 404 has a body, so the
  real code is preserved; a HEAD 404 has none and is reported as
  NoSuchKey regardless. The probe also drops the extra HEAD request.
- fs: Put flushes the data and parent directory to disk before
  returning, so a crash cannot leave an object present but truncated.
- fs: Put widens the object mode from CreateTemp's 0600 to 0644, so a
  backup written by one user can be read by another.
- fs: objectPath uses a relative-path escape check; the old
  string-prefix check rejected every key when the root resolved to /.
- fs: Get rejects a key that resolves to a directory with
  ErrKeyNotFound instead of a later, opaque read error.
- fs: Put enforces the size contract (non-negative, exact byte count)
  so a wrong size fails loudly instead of storing a short object; the
  Storage interface now documents the contract for both backends.
- fs: New sweeps stale temp files left by interrupted Puts, which are
  otherwise hidden from List and cannot be removed through the API.
- fs: List returns a non-nil empty slice, matching the s3 backend.
- s3 integration test: tag integration_docker so unit:fullSkipDocker
  excludes it, matching the repo convention.

Part of TNTP-8210
@sssciel sssciel force-pushed the g.rybakov/tntp-8210-s3-fs branch from a669188 to 0849d6c Compare July 6, 2026 13:40
@bigbes bigbes merged commit 939a3da into master Jul 6, 2026
24 checks passed
@bigbes bigbes deleted the g.rybakov/tntp-8210-s3-fs branch July 6, 2026 15:33
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.

3 participants