Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Lchangliang committed Jul 29, 2024
1 parent 06e1c79 commit 1cee3af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion be/src/cloud/cloud_cumulative_compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CloudCumulativeCompaction::CloudCumulativeCompaction(CloudStorageEngine& engine,
CloudCumulativeCompaction::~CloudCumulativeCompaction() = default;

Status CloudCumulativeCompaction::prepare_compact() {
if (_tablet->tablet_state() != TABLET_RUNNING &&
if (_tablet->tablet_state() != TABLET_RUNNING && config::enable_new_tablet_do_compaction &&
dynamic_cast<CloudTablet*>(_tablet.get())->alter_version() == -1) {
return Status::InternalError("invalid tablet state. tablet_id={}", _tablet->tablet_id());
}
Expand Down
5 changes: 4 additions & 1 deletion cloud/src/meta-service/meta_service_job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ static constexpr int SCHEMA_CHANGE_DELETE_BITMAP_LOCK_ID = -2;

bool check_compaction_input_verions(const TabletCompactionJobPB& compaction,
const TabletJobInfoPB& job_pb) {
if (!job_pb.schema_change().has_alter_version()) return true;
DCHECK_EQ(compaction.input_versions_size(), 2) << proto_to_json(compaction);
DCHECK_LE(compaction.input_versions(0), compaction.input_versions(1))
<< proto_to_json(compaction);

int64_t alter_version = job_pb.schema_change().alter_version();
return (compaction.type() == TabletCompactionJobPB_CompactionType_BASE &&
compaction.input_versions(1) <= alter_version) ||
Expand Down Expand Up @@ -316,7 +318,8 @@ void start_schema_change_job(MetaServiceCode& code, std::string& msg, std::strin
err = txn->get(job_key, &job_val);
if (err == TxnErrorCode::TXN_OK) {
job_pb.ParseFromString(job_val);
if (job_pb.has_schema_change() && job_pb.schema_change().id() == schema_change.id() &&
if (job_pb.has_schema_change() && job_pb.schema_change().has_alter_version() &&
job_pb.schema_change().id() == schema_change.id() &&
job_pb.schema_change().initiator() == schema_change.initiator()) {
response->set_alter_version(job_pb.schema_change().alter_version());
return;
Expand Down

0 comments on commit 1cee3af

Please sign in to comment.