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

avoid re-get block when storing the bytes #41

Open
iwanbk opened this issue Jan 30, 2025 · 0 comments
Open

avoid re-get block when storing the bytes #41

iwanbk opened this issue Jan 30, 2025 · 0 comments

Comments

@iwanbk
Copy link
Member

iwanbk commented Jan 30, 2025

s3-cas/src/cas/fs.rs

Lines 276 to 277 in 19f9841

// first load the block again from the DB
let block = match block_map.get_block_obj(&block_hash) {

in above lines, it re-get the data that previously stored, it means extra unnecessary operations.
We could avoid it, the alternative is for the self.meta_store.write_meta_for_block to also returns the data blocks.

See also whether we could use update_and_fetch inside the write_meta_for_block for this purpose

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