Conversation
Because namespace property can be changed during runtime
iwanbk
force-pushed
the
ns-worm
branch
2 times, most recently
from
April 23, 2025 06:40
b770d9e to
ae4ee1c
Compare
worm : write once read multiple it means that the written key can't be deleted/updated.
There was a problem hiding this comment.
Pull Request Overview
This PR updates the namespace handling to use a singleton pattern via a shared cache and adds support for WORM mode to prevent unwanted key modifications. Key changes include:
- Introducing a NamespaceCache to share namespace instances across connections.
- Updating connection processing and command handling (including SELECT and NSSET) to use the shared namespace cache.
- Adding an integration test to validate WORM mode protection.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| respd/tests/integration_test.rs | Adds shared namespace cache initialization and new worm protection tests |
| respd/src/storage.rs | Introduces update_namespace_meta to support updating namespace metadata |
| respd/src/server.rs | Updates process function and connection handling to include the shared namespace cache |
| respd/src/namespace.rs | Converts Namespace tree field to Arc and adds WORM mode checks for set and delete operations |
| respd/src/cmd.rs | Updates the NSSET command parsing and handling to integrate with the new namespace cache |
This was referenced Apr 23, 2025
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.
Change to singleton because namespace property can be changed during runtime