Feat/implement issues 247 268#269
Merged
Merged
Conversation
…__ttl: side-table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Implementation of 12 GitHub issues (bugs + features) addressing critical security, persistence, performance, and HTTP server integration problems, plus silent error handling fixes in production.
🎯 Type of Change
feat:)fix:)docs:)perf:)test:)🔍 What Changed?
🌐 HTTP / API
actix-corsmiddleware configured viaCORS_ENABLEDandCORS_ORIGINSenv vars. Supports specific origins or permissive mode. Registered before auth middleware for OPTIONS preflight.get_client_ip()extractsX-Forwarded-Forheader with fallback topeer_addr(). Addedparse_x_forwarded_for()for multi-IP header parsing with unit tests.TokenManagernow loads tokens from the engine (__token:prefix) on startup and persists create/revoke operations. Tokens survive server restarts.require_permission()guard added to all HTTP handlers:Read(GET),Write(PUT),Delete(DELETE),Admin(/admin/*). Health endpoints remain auth-free.AccessControlpolicies by principal, operation, and resource key. Configurable viaACCESS_CONTROL_ENABLEDenv var.🗄️ Storage Engine
expires_atmetadata preserved across flush and restart via__ttl:{key}side-table in the engine.get_cf()andscan_cf()check expiry even after engine restart.Transactionnow has awrite_buffer: HashMap<Vec<u8>, Option<Vec<u8>>>.get()checks the buffer before the engine.set(),delete(),commit(),rollback()updated accordingly. 5 new unit tests.🔒 Error Handling Hardening
debug_assert!([BUG] prefix compression: debug_assert! permite truncamento silencioso em release #263): Converted toErr(LsmError::InvalidArgument)— release builds no longer silently truncate values >255 bytes.panic!([BUG] prefix compression: panic! em decode_keys corrompe dados e crasha o processo #264): Replaced withErr(LsmError::CorruptedData)indecode_keys— corrupted data no longer crashes the process.std::sync::Mutexwithparking_lot::MutexinGlobalBlockCache— no poison recovery, no risk of masking panics.🔍 Observability / Tooling
scrub_file()now validates CRC32 for every data block.ScrubResultwith detailed statistics (total/corrupt blocks and bytes).scrub_with_version_set()detects orphan files and orphan tables. 7 new tests.⚙️ Testing
cargo test --all-features) — 435 tests, 0 failurescargo fmt --all— cleancargo clippy --all-targets --all-features -- -D warnings— clean📚 Related Issues
❗ Version Bump
✅ Checklist
mainand auto-release