-
Notifications
You must be signed in to change notification settings - Fork 165
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
base: master
Are you sure you want to change the base?
Conversation
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>
There was a problem hiding this 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());; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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)
toStatus 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.