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

storage: using concurrent data structure to incrementally maintain storage snapshot #620

Open
skyzh opened this issue Apr 11, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@skyzh
Copy link
Member

skyzh commented Apr 11, 2022

Currently, every operation on storage snapshot will clone and create a new full snapshot, which contains a list of rowsets. Indeed, we can use some concurrent data structure to maintain this, so as to reduce the need of cloning.

// Add epoch number and make the modified snapshot available.
let mut inner = self.inner.lock();
assert_eq!(inner.epoch, current_epoch);
inner.epoch += 1;
let epoch = inner.epoch;
inner.status.insert(epoch, Arc::new(snapshot));
inner
.rowset_deletion_to_apply
.insert(epoch, rowset_deletion_to_apply);

https://github.com/ibraheemdev/seize looks like a good choice.

@BaymaxHWY
Copy link
Contributor

we can use some concurrent data structure to maintain this, so as to reduce the need of cloning.

how to achieve this? make a snapshot of each epoch and only track the different from last?

@skyzh
Copy link
Member Author

skyzh commented Apr 21, 2022

how to achieve this? make a snapshot of each epoch and only track the different from last?

Exactly, but I didn't come up with a detailed way to achieve this... Indeed, every operation to RisingLight's storage manifest is simply a diff operation.

@BaymaxHWY
Copy link
Contributor

I'm sorry, i have no relevant experience about this. Unable to give helpful advice :)
Hope i can help you in the future.

@skyzh
Copy link
Member Author

skyzh commented Apr 21, 2022

No worries 🤪

@skyzh skyzh added the enhancement New feature or request label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants