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

fix file_size always = 0 bug #237

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/blob_gc_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ Status BlobGCJob::DoRunGC() {
// uint64_t total_entry_num = 0;
// uint64_t total_entry_size = 0;

uint64_t file_size = 0;

std::string last_key;
bool last_key_valid = false;
gc_iter->SeekToFirst();
Expand Down Expand Up @@ -203,9 +201,10 @@ Status BlobGCJob::DoRunGC() {

// Rewrite entry to new blob file
if ((!blob_file_handle && !blob_file_builder) ||
file_size >= blob_gc_->titan_cf_options().blob_file_target_size) {
if (file_size >= blob_gc_->titan_cf_options().blob_file_target_size) {
assert(blob_file_builder);
(blob_file_handle->GetFile()->GetFileSize() >=
blob_gc_->titan_cf_options().blob_file_target_size)) {
if ((blob_file_handle->GetFile()->GetFileSize() >=
blob_gc_->titan_cf_options().blob_file_target_size)) {
assert(blob_file_handle);
assert(blob_file_builder->status().ok());
blob_file_builders_.emplace_back(std::make_pair(
Expand All @@ -222,7 +221,6 @@ Status BlobGCJob::DoRunGC() {
blob_file_builder = std::unique_ptr<BlobFileBuilder>(
new BlobFileBuilder(db_options_, blob_gc_->titan_cf_options(),
blob_file_handle->GetFile()));
file_size = 0;
}
assert(blob_file_handle);
assert(blob_file_builder);
Expand Down