forked from fjall-rs/lsm-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
encryptionEncryption subsystem, AES-GCM, key managementEncryption subsystem, AES-GCM, key managementtestTests, test infrastructure, test helpersTests, test infrastructure, test helpers
Description
Summary
Encryption test infrastructure improvements — extract helper (was #127) + add comprehensive stress test (was #128). Both from review of PR #105.
Part 1: Extract tempfile helper (was #127)
Block from_file tests repeat the same tempfile + write + reopen + handle construction ~10 times in src/table/block/mod.rs test module.
Extract:
fn write_block_to_tempfile(
data: &[u8],
block_type: BlockType,
compression: CompressionType,
encryption: Option<&dyn EncryptionProvider>,
) -> crate::Result<(std::fs::File, BlockHandle, Header)>Files: src/table/block/mod.rs (test module, lines ~580-1400)
Part 2: Mixed-load stress test (was #128)
No test exercises encryption under realistic mixed-workload conditions.
Combination matrix:
- Encryption: None, AES-256-GCM
- Compression: None, lz4, zstd (level 1, level 3)
- Operations: point writes, updates, deletes, range tombstones, merge operators, point reads, range scans, MVCC snapshots
- Concurrency: single-threaded + multi-threaded (4-8 writers, 2-4 readers)
- Lifecycle events: memtable flush, compaction, tree close + reopen (recovery)
Files: tests/encryption_roundtrip.rs or new tests/encryption_stress.rs
Why merge
#127 is a prerequisite for #128 — the extracted helper makes writing stress test variants trivial. Both improve encryption test coverage, same review context.
References
- PR perf(encryption): reduce allocations in encrypt/decrypt block pipeline #105 review (both identified there)
- refactor(test): extract tempfile helper for block from_file tests #127 (closed, merged into this issue)
Time estimate
1.5d
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
encryptionEncryption subsystem, AES-GCM, key managementEncryption subsystem, AES-GCM, key managementtestTests, test infrastructure, test helpersTests, test infrastructure, test helpers