Add Pebble SST ingest snapshot transfer - #1130
Conversation
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Implementation and caller audit are complete on current HEAD Local evidence:
Please review checkpoint consistency, manifest validation, atomic rollback/crash recovery, legacy fallback, and the audited native/MVCC/SST swap callers. @codex review |
There was a problem hiding this comment.
Code Review
This pull request implements Pebble SST Ingest Snapshot Transfer, introducing a new snapshot format (EKVSSTI1) that exports external SST files from a point-in-time checkpoint and ingests them atomically on the receiver side with rollback support. Feedback on these changes focuses on enhancing resource safety and robustness. Key recommendations include using defer (and wrapping loop bodies in anonymous functions) to prevent file descriptor leaks in the event of panics during file operations, avoiding global mutable state in tests to prevent data races, and replacing filepath.Glob with os.ReadDir to handle directory paths containing glob characters safely.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Addressed and resolved all five current-head Gemini threads in signed commit
Verification on the new HEAD:
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Review-loop stop recorded for current HEAD
The PR remains open and was not merged. |
## Summary - add the focused physical snapshot object-offload design and link it from the storage roadmap - expose the newest WAL-valid persisted FSM snapshot as a single-use stream paired with Raft index, term, ConfState, byte count, and CRC32C - add complete-payload restore preparation that preserves the existing FSM header and leaves store-format dispatch to the receiver - preserve the existing logical external-restore header behavior through focused regression coverage ## Dependency and scope PR #1130 owns the Pebble SST ingest snapshot stream. This pull request treats the complete FSM payload as opaque and does not parse or duplicate that format. Because #1130 is still in review, this pull request intentionally contains only the independently reviewable export/restore substrate. Object-store publication, runtime scheduling, retention/GC, and operator restore wiring remain later milestones in the focused design. ## Safety The exporter reads only a WAL-valid persisted Raft snapshot. Token index, metadata index, footer CRC32C, and the CRC32C recomputed during streaming must agree. The source file descriptor remains open for the whole stream, so local retention cannot replace the exported inode mid-upload. Physical restore targets an absent data directory and copies a verified regular file through the existing atomic restore preparation. The existing logical restore API and its synthetic KV header are unchanged. ## Tests - `go test ./internal/raftengine/etcd -count=1 -timeout=20m` - `go test -race ./internal/raftengine/etcd -run 'TestPreparePhysicalSnapshotRestoreAndExportOpaquePayload|TestPersistedSnapshotExport|TestOpenPersistedSnapshotExport' -count=1 -timeout=10m` - `go test ./... -run '^$' -count=1 -timeout=20m` - `golangci-lint run ./internal/raftengine/etcd/... --timeout=10m` - commit hook: full `golangci-lint`, 0 issues - `git diff --check` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **新機能** * PebbleのSST取り込み方式によるスナップショットの作成・転送・復元に対応しました。 * 復元前後の整合性検証を強化し、失敗時には既存データを保持します。 * 物理スナップショットのエクスポートと復元に対応しました。 * SST方式が利用できない場合は従来方式へ自動的に切り替えます。 * **ドキュメント** * SSTスナップショット転送および外部オブジェクトストレージへのオフロード設計を追加しました。 * **バグ修正** * 不完全な書き込みを正しく検出するよう改善しました。 <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
DB.Ingestinto a temporary database with atomic swap, rollback, and crash recoverySafety and rollout
Set
ELASTICKV_PEBBLE_SST_INGEST_SNAPSHOT=trueonly after every member runs a receiver-capable binary. Receivers always accept the new format. Invalid or unset values preserve legacy emission. Manifest, file bounds, exact lengths, SHA-256 digests, and EOF are verified before the live database is replaced.The shared restore swap now retains the old database until the replacement opens and metadata verifies. Startup recovers a single interrupted rollback directory and preserves ambiguous backups instead of deleting them.
Tests
go test ./store ./kv ./internal/raftengine/etcd -count=1 -timeout=20mgo test -race ./store ./kv ./internal/raftengine/etcd -run 'TestPebbleStoreSST|TestSSTIngest|TestCountingWriter|TestSwapInTempDB|TestKVFSMSnapshotRoundTripsSSTIngestPayload|TestGRPCSnapshotTransportRoundTripsSSTIngestPayload|TestPebbleStore_SnapshotRestore|TestPebbleStore_Restore' -count=1 -timeout=15m\n-go test ./adapter -count=1 -timeout=20m\n-golangci-lint --config=.golangci.yaml run --fix