apache / apache/kvrocks

Allow to delete keys by the prefix

Open
#2,628 5 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue help wanted
Dominant language
C++
Stars
4.4k
Forks
658
Avg merge
1d 20h
Merged PRs (30d)
10

Description

### Search before asking

- [X] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues.

### Motivation

- Using Namespace in cluster mode to easily flush the keys .

### Solution

- As i knew namespace simply prepend the namespace prefix to the user key and remove it before retrieving. But it couldn't achieve with just simple key prefix.

we use the hash bracket like below, if our namespace is `foo`, and key is 1234, it will be successfully removed all the keys with same namespace.
{foo}:1234

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing how namespaces and cluster-mode key deletion are handled, then trace the behavior of keys using the `{foo}:1234` hash-bracket prefix. The issue does not name files or tests, so first identify the relevant deletion entry point and existing coverage. Done means keys for a namespace can be deleted by prefix without removing unrelated keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, redis
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.