Skip to content

Check a status in InstallOutputBlobFiles and Rewrite BatchWriteNewIndices#243

Open
apple-ouyang wants to merge 3 commits intotikv:masterfrom
apple-ouyang:check_status
Open

Check a status in InstallOutputBlobFiles and Rewrite BatchWriteNewIndices#243
apple-ouyang wants to merge 3 commits intotikv:masterfrom
apple-ouyang:check_status

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

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