Update AGENTS.md: SMB Previous versions + Session summary
This commit is contained in:
137
AGENTS.md
137
AGENTS.md
@@ -3052,6 +3052,143 @@ impl Compressor {
|
||||
}
|
||||
```
|
||||
|
||||
### Previous Versions Methods ⭐⭐⭐⭐⭐ (NEW)
|
||||
|
||||
| Method | Purpose | Implementation |
|
||||
|--------|---------|----------------|
|
||||
| `list_previous_versions()` | Enumerate snapshot versions | Scan .snapshots dir + GMT token conversion |
|
||||
| `open_previous_version()` | Open file from snapshot | Match GMT token to snapshot |
|
||||
| `restore_previous_version()` | Restore from snapshot | Call restore_snapshot() |
|
||||
|
||||
**GMT Token Format**: `@GMT-YYYY.MM.DD-HH.MM.SS` (SMB shadow copy standard)
|
||||
|
||||
### 测试验证 ✅
|
||||
|
||||
```bash
|
||||
cargo build -p markbase-core --features smb-server # ✅ 0 error
|
||||
cargo test -p markbase-core --lib --features smb-server # ✅ 229 passed, 0 failed
|
||||
```
|
||||
|
||||
### 相关文件
|
||||
|
||||
**新增文件**:
|
||||
```
|
||||
markbase-core/src/vfs/compression.rs (134 lines)
|
||||
├── Compressor struct
|
||||
├── compress/decompress methods
|
||||
├── compress_file/decompress_file utilities
|
||||
├── detect_compression extension check
|
||||
└── get_decompressed_size helper
|
||||
```
|
||||
|
||||
**修改文件**:
|
||||
```
|
||||
markbase-core/src/vfs/mod.rs (+72 lines)
|
||||
├── VfsSnapshotInfo struct
|
||||
├── VfsQuota/VfsQuotaUsage structs
|
||||
├── VfsCompression/VfsCompressionConfig types
|
||||
├── VfsPreviousVersion struct (NEW)
|
||||
└── Snapshot/Quota/Previous versions trait methods
|
||||
|
||||
markbase-core/src/vfs/local_fs.rs (+193 lines)
|
||||
├── Snapshot implementation (copy-on-write)
|
||||
├── Quota implementation (JSON metadata)
|
||||
├── Previous versions implementation (NEW)
|
||||
└── Helper methods (copy_dir_recursive, calculate_size, count_files, systemtime_to_gmt_token)
|
||||
|
||||
markbase-core/Cargo.toml (+1 line)
|
||||
└── zstd = "0.13"
|
||||
```
|
||||
|
||||
### ZFS SMB Feature Comparison - Complete ⭐⭐⭐⭐⭐
|
||||
|
||||
| Feature | ZFS SMB | MarkBase SMB | Status |
|
||||
|---------|---------|--------------|--------|
|
||||
| **Snapshots** | ✅ Native ZFS | ✅ VFS layer | ✅ Complete |
|
||||
| **Quotas** | ✅ Per-dataset | ✅ VFS layer | ✅ Complete |
|
||||
| **Compression** | ✅ LZ4/ZSTD | ✅ ZSTD | ✅ Complete |
|
||||
| **Previous versions** | ✅ Shadow copy | ✅ VFS layer | ✅ Complete |
|
||||
| **ACLs** | ✅ NFSv4/SMB | ⏳ Blocked | Requires smb-server crate extension |
|
||||
| **Oplocks** | ✅ Samba handles | ⏳ Blocked | Requires smb-server protocol |
|
||||
| **Dedup** | ✅ ZFS native | ⏳ Pending | Low priority |
|
||||
| **RAID-Z** | ✅ ZFS native | ⏳ Pending | Low priority |
|
||||
|
||||
---
|
||||
|
||||
**最后更新**:2026-06-20
|
||||
**版本**:1.37(SMB Previous Versions 完成)
|
||||
|
||||
## Session Summary - 2026-06-20 ⭐⭐⭐⭐⭐
|
||||
|
||||
**Session Duration**: ~4 hours
|
||||
**Commits**: 6 commits (f016525, 9c44bd5, 70cc6d9, 716eea7, 837ffa9)
|
||||
|
||||
### Completed Tasks ✅
|
||||
|
||||
| Task | Priority | Status | Git Commit |
|
||||
|------|----------|--------|------------|
|
||||
| **SMB Snapshots** | High | ✅ Complete | f016525 |
|
||||
| **SMB Quotas** | Medium | ✅ Complete | 9c44bd5 |
|
||||
| **SMB Compression** | Medium | ✅ Complete | 70cc6d9 |
|
||||
| **SMB Previous versions** | Medium | ✅ Complete | 837ffa9 |
|
||||
|
||||
### Blocked Tasks ⏳
|
||||
|
||||
| Task | Priority | Status | Blocker |
|
||||
|------|----------|--------|---------|
|
||||
| **SMB ACLs** | High | ⏳ Blocked | Requires smb-server crate extension |
|
||||
| **SMB Oplocks** | Medium | ⏳ Blocked | Requires smb-server protocol |
|
||||
|
||||
### Pending Tasks (Low Priority)
|
||||
|
||||
| Task | Priority | Status |
|
||||
|------|----------|--------|
|
||||
| **SMB Deduplication** | Low | ⏳ Pending |
|
||||
| **SMB RAID-Z** | Low | ⏳ Pending |
|
||||
|
||||
### Key Achievements ⭐⭐⭐⭐⭐
|
||||
|
||||
1. **ZFS-style SMB features at VFS layer**: Snapshots, Quotas, Compression, Previous versions all implemented
|
||||
2. **GMT token conversion**: SystemTime → @GMT-YYYY.MM.DD-HH.MM.SS format
|
||||
3. **Snapshot management**: Copy-on-write, metadata tracking, restoration
|
||||
4. **Quota enforcement**: Space/file limits, soft limits, grace periods
|
||||
5. **ZSTD compression**: Threshold filtering, transparent compression
|
||||
|
||||
### Files Modified Summary
|
||||
|
||||
```
|
||||
markbase-core/src/vfs/
|
||||
├── mod.rs (+100 lines) - VfsBackend trait extensions
|
||||
├── local_fs.rs (+193 lines) - LocalFs implementations
|
||||
├── compression.rs (134 lines) - NEW compression module
|
||||
└── Cargo.toml (+1 line) - zstd dependency
|
||||
```
|
||||
|
||||
### Test Results ✅
|
||||
|
||||
All 229 tests pass consistently across all features.
|
||||
|
||||
### Next Steps Decision Required ⭐⭐⭐⭐⭐
|
||||
|
||||
**Blocked tasks require smb-server crate changes**:
|
||||
- ACLs (NFSv4/SMB ACL support)
|
||||
- Oplocks (opportunistic locking)
|
||||
|
||||
**Options**:
|
||||
1. ⭐⭐⭐⭐⭐ Implement ACLs at VFS layer (foundation for smb-server integration)
|
||||
2. ⭐⭐⭐⭐ Skip blocked tasks, focus on low-priority dedup/RAID-Z
|
||||
3. ⭐⭐⭐⭐ Ask user for other priorities (web frontend, SSH features, etc.)
|
||||
4. ⭐⭐⭐ Create smb-server crate PR for ACL/Oplock support
|
||||
|
||||
---
|
||||
|
||||
**最后更新**:2026-06-20
|
||||
**版本**:1.38(Session Summary Complete)
|
||||
pub fn decompress(&self, data: &[u8]) -> Result<Vec<u8>, VfsError>;
|
||||
pub fn should_compress(&self, size: u64) -> bool;
|
||||
}
|
||||
```
|
||||
|
||||
### 测试验证 ✅
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user