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

Check a status in InstallOutputBlobFiles and Rewrite BatchWriteNewIndices #243

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

apple-ouyang
Copy link
Contributor

The issue is here #238.
I push 3 commits.
One is add a status check.
One is change the void BatchWriteNewIndices(BlobFileBuilder::OutContexts& contexts, Status* s) to Status BatchWriteNewIndices(BlobFileBuilder::OutContexts& contexts)
One is delete MergeBlobIndex if we just don't use it when gc_merge_rewrite_ = false.

If you want, I can squash the 3 commit into 1 commit.

Signed-off-by: Wang Haitao <wanghaitao.ouyang@foxmail.com>
to have the same interface

Signed-off-by: Wang Haitao <wanghaitao.ouyang@foxmail.com>
Signed-off-by: Wang Haitao <wanghaitao.ouyang@foxmail.com>
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

sorry for the late review

std::string index_entry;
BlobIndex original_index = ctx->original_blob_index;
ParsedInternalKey ikey;
if (!ParseInternalKey(ctx->key, &ikey)) {
*s = Status::Corruption(Slice());
return;
return Status::Corruption(Slice());;
Copy link
Member

Choose a reason for hiding this comment

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

add a meaning error message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll add one

}
if (!gc_merge_rewrite_) {
merge_blob_index.EncodeToBase(&index_entry);
const BlobIndex &index = ctx->new_blob_index;
Copy link
Member

Choose a reason for hiding this comment

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

why is it different from before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the merge blob index is only used in the second if branch. I just think we should only declare the merge blob index when we truly use it. This will help others understand the code easily.

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.

2 participants