Skip to content

Added Rename Functionality to Sidebar Items#274

Closed
Jitmisra wants to merge 0 commit intoapache:unstablefrom
Jitmisra:unstable
Closed

Added Rename Functionality to Sidebar Items#274
Jitmisra wants to merge 0 commit intoapache:unstablefrom
Jitmisra:unstable

Conversation

@Jitmisra
Copy link
Contributor

@Jitmisra Jitmisra commented Mar 9, 2025

Added Rename Functionality to Sidebar Items

2025-03-09.20-06-03.mov

issue
#272

@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 5.04202% with 113 lines in your changes missing coverage. Please review.

Project coverage is 45.14%. Comparing base (6c56470) to head (9424c57).
Report is 44 commits behind head on unstable.

Files with missing lines Patch % Lines
store/store.go 6.97% 78 Missing and 2 partials ⚠️
server/api/namespace.go 0.00% 31 Missing ⚠️
server/route.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #274      +/-   ##
============================================
+ Coverage     43.38%   45.14%   +1.75%     
============================================
  Files            37       45       +8     
  Lines          2971     4404    +1433     
============================================
+ Hits           1289     1988     +699     
- Misses         1544     2206     +662     
- Partials        138      210      +72     
Flag Coverage Δ
unittests 45.14% <5.04%> (+1.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

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

The UI part looks good to me. Could you help review the backend part? cc @git-hulk

@git-hulk
Copy link
Member

@PragmaTwice Yes for sure, will have a look soon.

@Jitmisra The namespace would be composed as the prefix of the cluster name, so it cannot be changed once any clusters were created.

@Jitmisra
Copy link
Contributor Author

Jitmisra commented Mar 10, 2025

Hi @git-hulk, could be please guide me a little more on this as I am little new to go and still learning a lot.

@git-hulk
Copy link
Member

@Jitmisra Kvrocks's controller has the namespace mechanism for managing clusters like the dir in FS, and it will be used as the prefix when storing the cluster information.

for example, if a cluster hello is under the namespace A, then the key of the cluster would be something like /kvrocks/metadata/A/hello. So it cannot simply change the namespace name, if it has any clusters.

@SharonIV0x86
Copy link
Contributor

@Jitmisra Kvrocks's controller has the namespace mechanism for managing clusters like the dir in FS, and it will be used as the prefix when storing the cluster information.

for example, if a cluster hello is under the namespace A, then the key of the cluster would be something like /kvrocks/metadata/A/hello. So it cannot simply change the namespace name, if it has any clusters.

It seems like renaming a namespace in Kvrocks is not straightforward because the namespace is embedded in the key paths. Changing the namespace would require updating all related keys, which is a complex operation and not directly supported.

When you mentioned that we cannot simply change the namespace name, if it has any clusters how about a workaround, that when renaming a namespace a new namespace is created and all the clusters in the older namespace are copied/moved to the new one, and the older namespace is removed.

This is an expensive workaround just to rename a namespace, a better solution is to be mindful during naming 😶‍🌫️

@PragmaTwice
Copy link
Member

Hmm it seems a little tricky for renaming, maybe we can focus on #273 first as it doesn't involve backend logic.

@Jitmisra
Copy link
Contributor Author

Thanks, @SharonIV0x86 and @git-hulk , for the clarification!

I now understand that renaming a namespace is tricky due to its role as a prefix in cluster metadata. The workaround of creating a new namespace and migrating clusters sounds feasible but would indeed be resource-intensive.

Would it make sense to introduce a migration utility in the future if renaming becomes a necessary feature? Or should we focus on reinforcing best practices around initial namespace naming instead?

For now I agree with @PragmaTwice that we can proceed with #273 while keeping this discussion open for possible solutions. Let me know your thoughts!

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.

5 participants