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

Introduce the read_root_keys to the AdminKeyValueStore #3085

Open
MathieuDutSik opened this issue Jan 6, 2025 · 0 comments
Open

Introduce the read_root_keys to the AdminKeyValueStore #3085

MathieuDutSik opened this issue Jan 6, 2025 · 0 comments
Assignees

Comments

@MathieuDutSik
Copy link
Contributor

We are currently using the root_key in the AdminKeyValueStore. This is a formalization of the notion of partition keys in databases.

What is missing is the ability to get the list of root keys. That is we would like to have

fn get_root_keys(&self) -> Result<Vec<Vec<u8>>, Self::Error>

There are two use cases for that:

  • Accessing to the list of chains of a validator.
  • Migrating data from one storage to another.

There are obstacles to that:

  • For DynamoDb and ScyllaDb, we could access the root keys easily since they are partition keys.
  • The RocksDb does not have a notion of partition key.
    • Instead, we simply concatenate the keys like root_key + key.
    • This design was chosen because having one RocksDB instance per root key would lead to an overflow in the number of opened files.
    • One idea would be to add some entry indicating the creation of a new root key when doing a clone_with_root_key. This would make the clone_with_root_key async but that is fine.
  • The support in storage service would also be somewhat difficult. But a priori possible.
@MathieuDutSik MathieuDutSik self-assigned this Jan 6, 2025
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

No branches or pull requests

1 participant