Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: cheap store renaming migration #20258

Open
yihuang opened this issue May 3, 2024 · 0 comments
Open

[Feature]: cheap store renaming migration #20258

yihuang opened this issue May 3, 2024 · 0 comments

Comments

@yihuang
Copy link
Collaborator

yihuang commented May 3, 2024

Summary

Currently to rename a store in upgrade, it renames all the existing keys in that store, which is very heavy.
We propose a cheap way to do that.

Problem Definition

No response

Proposed Feature

We had cheap renaming in memiavl, I think the idea can be adapted to iavl as well similarly. The idea is to maintain a version-ed logical name to physical name mapping, to rename a store, we simply change the logical name in the mapping.

{prefix}-{version}: [(logical store name, physical store name)]

When load a multistore, we load the store name mapping into memory as well, and handle the name conversion accordingly.

The mapping should be stored in a version-ed way, and only save to db when modified, when loading a multistore, we should seek the correct version of the mapping based on target version.

The map is small, renaming operations are not frequent, performance overhead should be very small.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants