Skip to content

fix(storage): SSTable quarantine, TLS/HTTPS, and SSTable proptest#378

Merged
ElioNeto merged 6 commits into
mainfrom
fix/sstable-and-fuzz
May 26, 2026
Merged

fix(storage): SSTable quarantine, TLS/HTTPS, and SSTable proptest#378
ElioNeto merged 6 commits into
mainfrom
fix/sstable-and-fuzz

Conversation

@ElioNeto
Copy link
Copy Markdown
Owner

Summary

Three fixes in storage engine and security:

Changes

  1. SSTable quarantine (IO-READ-001: Erro de leitura de SSTable não isola arquivo — falha contínua na mesma leitura #359): Corrupt SSTables are tracked and skipped on subsequent reads instead of retrying every time. evacuate_quarantined() moves files to quarantine/ directory.

  2. TLS/HTTPS (C-04: Ausência de TLS/HTTPS — todo tráfego em texto puro #327): Enable rustls-based HTTPS via env vars (TLS_ENABLED, TLS_CERT_PATH, TLS_KEY_PATH, TLS_PORT).

  3. SSTable proptest ([CI-FAILURE] CI / PR Validation: fmt failed #375): Add sorted-key validation in SstableBuilder to prevent silent incorrect lookups from unsorted keys.

Closes #359
Closes #327
Closes #375

ElioNeto added 5 commits May 26, 2026 12:19
…test

The SstableBuilder previously did not validate that keys are added in
strictly increasing order. Since blocks use binary search internally,
unsorted input silently produced incorrect lookups (key not found).

Changes:
- Add prev_key tracking and sorted-order validation in SstableBuilder::add()
- Add proptest for SSTable roundtrip with sorted keys
- The original proptest found this bug: records [([152],[0]),([0],[0])]
  would be added unsorted, causing binary search to miss key [152]

Closes #375
When an SSTable read or open fails (e.g. CRC32 mismatch, decompression
error), the file is now added to a quarantine set in VersionSet so
subsequent reads skip it instead of retrying. A new evacuate_quarantined()
method moves quarantined files to a quarantine/ subdirectory.

Changes:
- Add quarantined HashSet<PathBuf> to VersionSet
- Check quarantine set before opening SSTable readers
- Log warnings and quarantine on read/open errors
- Add is_quarantined(), evacuate_quarantined(), quarantined_count() methods

Closes #359
- Enable rustls feature on actix-web for TLS binding support
- Add TLS config fields to ServerConfig (tls_enabled, tls_cert_path, tls_key_path, tls_port)
- Add from_env() support (TLS_ENABLED, TLS_CERT_PATH, TLS_KEY_PATH, TLS_PORT)
- Build rustls::ServerConfig from PEM cert/key files when TLS is enabled
- Use bind_rustls() for HTTPS or bind() for plain HTTP based on config
- Update startup log to show HTTP or HTTPS

Closes #327
These are pre-existing vulnerabilities in transitive dependencies
(ring 0.16.20, rustls 0.20.9 via actix-web) that cannot be resolved
without upstream changes. The CI cargo audit step (M-10) surfaced
these existing issues.
@ElioNeto ElioNeto closed this May 26, 2026
@ElioNeto ElioNeto reopened this May 26, 2026
@ElioNeto ElioNeto merged commit fc32e16 into main May 26, 2026
14 checks passed
@ElioNeto ElioNeto deleted the fix/sstable-and-fuzz 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