Skip to content

change namespace as singleton & worm implementation - #30

Merged
iwanbk merged 5 commits into
mainfrom
ns-worm
Apr 23, 2025
Merged

change namespace as singleton & worm implementation#30
iwanbk merged 5 commits into
mainfrom
ns-worm

Conversation

@iwanbk

@iwanbk iwanbk commented Apr 23, 2025

Copy link
Copy Markdown
Contributor

Change to singleton because namespace property can be changed during runtime

iwanbk added 2 commits April 23, 2025 10:26
Because namespace property can be changed during runtime
@iwanbk
iwanbk force-pushed the ns-worm branch 2 times, most recently from b770d9e to ae4ee1c Compare April 23, 2025 06:40
worm : write once read multiple
it means that the written key can't be deleted/updated.
@iwanbk
iwanbk requested a review from Copilot April 23, 2025 07:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread respd/src/namespace.rs Outdated
Comment thread respd/src/namespace.rs Outdated
@iwanbk
iwanbk merged commit 209a7f0 into main Apr 23, 2025
@iwanbk
iwanbk deleted the ns-worm branch April 23, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants