Skip to content

perf(core): RwLock engine, fuzz testing, and more#380

Merged
ElioNeto merged 3 commits into
mainfrom
fix/remaining-complex-issues
May 26, 2026
Merged

perf(core): RwLock engine, fuzz testing, and more#380
ElioNeto merged 3 commits into
mainfrom
fix/remaining-complex-issues

Conversation

@ElioNeto
Copy link
Copy Markdown
Owner

Summary

Three significant changes to the ApexStore storage engine:

1. STARVATION-001 — RwLock Engine Core (#360)

Changed Engine's core lock from parking_lot::Mutex to parking_lot::RwLock. This allows concurrent reads (get, scan, keys, stats, snapshots) to proceed in parallel without blocking each other. Writes (put, delete, flush, compact, batch) still acquire exclusive access via write().

  • Added lock_core_mut() for write access alongside lock_core() (reads)
  • Classified all 24 lock sites as read or write operations
  • Updated Transaction, scrubber, tests accordingly
  • All 554 unit tests pass (including previously-failing delete_range and TTL tests)

2. TEST-001 — Fuzz Testing (#371)

Added cargo-fuzz infrastructure with two fuzz targets:

  • wal — fuzzes WAL write_record, write_batch, recovery, TTL records (1000 runs, 0 crashes)
  • sstable — fuzzes SSTable build, get, scan, bloom filter (1000 runs, 0 crashes)

3. Remaining issues

The following issues are still open and have been deferred due to complexity:

Closes #360
Closes #371

ElioNeto added 3 commits May 26, 2026 13:38
STARVATION-001: The Engine used a single Mutex to guard all access to
EngineCore, serializing both reads and writes. Changed to RwLock so
concurrent reads (get, scan, keys, stats, snapshot) can proceed in
parallel without blocking each other. Writes (put, delete, flush,
compact, batch operations) still acquire exclusive access.

- Add lock_core_mut() for write access alongside lock_core() (reads)
- Classify all 24 lock sites as read or write operations
- Update Transaction, scrubber to use appropriate lock type
- All 554 unit tests pass

Closes #360
- Add fuzz target for WAL (write_record, write_batch, recovery, TTL)
- Add fuzz target for SSTable (build, get, scan, bloom filter)
- Both targets exercised with 1000+ random inputs each — 0 crashes found
- Encryption disabled to focus fuzzing on format/decoding logic

Closes #371
@ElioNeto ElioNeto merged commit f45f8db into main May 26, 2026
14 checks passed
@ElioNeto ElioNeto deleted the fix/remaining-complex-issues branch May 26, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant