|
|
@ -76,7 +76,8 @@ Status DBImpl::PromoteL0(ColumnFamilyHandle* column_family, int target_level) { |
|
|
|
"PromoteL0 FAILED. Target level %d does not exist\n", |
|
|
|
"PromoteL0 FAILED. Target level %d does not exist\n", |
|
|
|
target_level); |
|
|
|
target_level); |
|
|
|
job_context.Clean(); |
|
|
|
job_context.Clean(); |
|
|
|
return Status::InvalidArgument("Target level does not exist"); |
|
|
|
status = Status::InvalidArgument("Target level does not exist"); |
|
|
|
|
|
|
|
return status; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Sort L0 files by range.
|
|
|
|
// Sort L0 files by range.
|
|
|
@ -96,7 +97,9 @@ Status DBImpl::PromoteL0(ColumnFamilyHandle* column_family, int target_level) { |
|
|
|
"PromoteL0 FAILED. File %" PRIu64 " being compacted\n", |
|
|
|
"PromoteL0 FAILED. File %" PRIu64 " being compacted\n", |
|
|
|
f->fd.GetNumber()); |
|
|
|
f->fd.GetNumber()); |
|
|
|
job_context.Clean(); |
|
|
|
job_context.Clean(); |
|
|
|
return Status::InvalidArgument("PromoteL0 called during L0 compaction"); |
|
|
|
status = |
|
|
|
|
|
|
|
Status::InvalidArgument("PromoteL0 called during L0 compaction"); |
|
|
|
|
|
|
|
return status; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (i == 0) continue; |
|
|
|
if (i == 0) continue; |
|
|
@ -107,7 +110,8 @@ Status DBImpl::PromoteL0(ColumnFamilyHandle* column_family, int target_level) { |
|
|
|
" have overlapping ranges\n", |
|
|
|
" have overlapping ranges\n", |
|
|
|
prev_f->fd.GetNumber(), f->fd.GetNumber()); |
|
|
|
prev_f->fd.GetNumber(), f->fd.GetNumber()); |
|
|
|
job_context.Clean(); |
|
|
|
job_context.Clean(); |
|
|
|
return Status::InvalidArgument("L0 has overlapping files"); |
|
|
|
status = Status::InvalidArgument("L0 has overlapping files"); |
|
|
|
|
|
|
|
return status; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -117,9 +121,10 @@ Status DBImpl::PromoteL0(ColumnFamilyHandle* column_family, int target_level) { |
|
|
|
ROCKS_LOG_INFO(immutable_db_options_.info_log, |
|
|
|
ROCKS_LOG_INFO(immutable_db_options_.info_log, |
|
|
|
"PromoteL0 FAILED. Level %d not empty\n", level); |
|
|
|
"PromoteL0 FAILED. Level %d not empty\n", level); |
|
|
|
job_context.Clean(); |
|
|
|
job_context.Clean(); |
|
|
|
return Status::InvalidArgument( |
|
|
|
status = Status::InvalidArgument( |
|
|
|
"All levels up to target_level " |
|
|
|
"All levels up to target_level " |
|
|
|
"must be empty"); |
|
|
|
"must be empty"); |
|
|
|
|
|
|
|
return status; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|