← Back to Pull requests

objectfs: use EROFS as snapshot format with blob and packfile storage #36

Closed
unknown closed this pull request without merging on Sep 13, 2026 03:24 UTC
View on GitHub
unknown unknown commented on Sep 12, 2026 17:50 UTC
Author

This PR implements EROFS-based snapshots and blob/packfile storage for ObjectFS in S3/GCS:

Key Changes


1. EROFS Inode Extended Attributes & ComposeFS Nodes (pkg/erofs):
- Added XattrNode and MetadataOnlyNode interfaces.
- Implemented BuildInlineXattrs and ReadXattrs to encode and decode inline EROFS extended attributes (user.digest, user.sha256, trusted., etc.).
- Updated WriteImage to allocate slot-aligned inode entries for inline xattrs and handle composefs metadata-only nodes (zero data blocks allocated for external file payloads).
- Updated DataReader to handle composefs metadata-only inodes (RawBlkaddr == 0).

2. Binary Blob & Packfile Storage Engine (pkg/objectfs/blob):
- Implemented 8-byte file header (4-byte magic OBJB, 1-byte version, 1-byte filetype, 2-byte padding).
- Supported standalone blob files (filetype=1) for large blobs (>64MB) with encoding headers, final lengths, and SHA256 checksums.
- Supported packfiles (filetype=2) and pack index files (filetype=3) for grouping smaller blobs with compressed payloads, table descriptors, and O(log N) binary search lookup in .idx index tables.
- Implemented BlobStore for writing and fetching blobs from storage backends.

3. ObjectFS Volume Snapshots & Recovery (pkg/objectfs/controller):
- Updated Volume.FlushToBackend to persist blobs to BlobStore and compile composefs-style EROFS snapshots stored at volumes/<volumeID>/meta/<timestamp>.erofs with a latest snapshot pointer.
- Verified generated EROFS snapshot images using erofs.Fsck.
- Implemented CreateSnapshot, ListSnapshots, and RestoreSnapshot in Volume and Server.
- Implemented snapshot recovery in LoadFromBackend, restoring directory hierarchies and file metadata while lazy-loading content on demand via BlobStore.

4. Testing:
- Added unit tests for inline xattrs and composefs metadata compilation in pkg/erofs/erofs_test.go.
- Added unit tests for blob encoding, packfile generation, .idx indexing, and BlobStore operations in pkg/objectfs/blob/blob_test.go.
- Added unit tests for EROFS snapshot creation, recovery from backend, and snapshot rollbacks in pkg/objectfs/controller/service_test.go.

Fixes #35

Diff: 286 lines (+214 / -72) across 3 files Reviewer: justinsb Review duration: 574m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 286 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.339
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #36"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.8% (MEDIUM) · Higher = larger blast radius
39.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.7% · Safe to merge
15.7%