kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

Make the default namepace name changable

Open PragmaTwice opened this issue 1 year ago • 8 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Motivation

It should be changable, as other namespaces.

Solution

No response

Are you willing to submit a PR?

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

PragmaTwice avatar May 05 '24 16:05 PragmaTwice

I have learned kvrocks for some time. I have the will to implement that (or have a try). There are two questions.

  1. Current namespace name is not modifiable, token can be modified by function(namespace set). Does changable 'name' refer to token?
  2. Default namespace is a literal value. How to make it modifiable, is it through config file ?

13015517713 avatar May 06 '24 05:05 13015517713

Yeah, IIRC it's currently something like __namespace, but I think it's better to be changable.

I don't know which one is better: store in rocksdb or in the config file.

cc @mapleFU @git-hulk do you have any idea?

PragmaTwice avatar May 06 '24 06:05 PragmaTwice

Also another big issue is to be compatible to old version: users can use new version of kvrocks with their old data, and they want these old data can work well.

PragmaTwice avatar May 06 '24 06:05 PragmaTwice

@PragmaTwice I'm not quite sure why we want to make it changeable. If for the space overhead consideration, it shouldn't take much more than the shorter one since the rocksdb has internal compression for the common prefix.

git-hulk avatar May 06 '24 06:05 git-hulk

Because I believe the default namespace should have the same status as other namespaces. Currently, in kvrocks, the default namespace is a very special namespace, and admins cannot switch the default namespace to another one. This has some significant drawbacks, such as certain admin operations can only be performed in the default namespace. I think this is a design flaw in kvrocks, and correcting it would require some cost at present.

PragmaTwice avatar May 06 '24 06:05 PragmaTwice

Just curious why it should be changable? Is there any reason for that?

Because I believe the default namespace should have the same status as other namespaces.

It's a good reason but I think we have too many legacy user and perhaps this means maintaining two parts of code?

mapleFU avatar May 06 '24 06:05 mapleFU

If there is a good solution, we can avoid maintenance difficulties and correct this problem. (But TBH, design errors in the early stage will lead to unbearable costs, and everyone should understand this truth.)

Perhaps it's time for us to reconsider the authentication and permission management in kvrocks.

PragmaTwice avatar May 06 '24 06:05 PragmaTwice

Currently, in kvrocks, the default namespace is a very special namespace, and admins cannot switch the default namespace to another one. This has some significant drawbacks, such as certain admin operations can only be performed in the default namespace.

We can achieve this by supporting the switch namespace API? The initial design didn't expect the admin to change data of other namespaces except to maintain the namespace/token pair itself. And I do agree the default namespace is very special, but it's to align with the Redis authentication way.

git-hulk avatar May 06 '24 06:05 git-hulk