Skip to content

Commit

Permalink
support schema change thread fast fail
Browse files Browse the repository at this point in the history
  • Loading branch information
DarvenDuan committed Sep 11, 2024
1 parent 91afeec commit 3e48d2a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions be/src/olap/schema_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,14 @@ Status VSchemaChangeDirectly::_inner_process(RowsetReaderSharedPtr rowset_reader
TabletSchemaSPtr base_tablet_schema,
TabletSchemaSPtr new_tablet_schema) {
bool eof = false;
int64_t tablet_id = new_tablet->tablet_id();
do {
// tablet may be dropped due to user cancel, schema change thread should fast fail
// and release tablet lock.
if (StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id) == nullptr) {
return Status::Error<TABLE_NOT_FOUND>("fail to find tablet. tablet_id={}",
tablet_id);
}
auto new_block = vectorized::Block::create_unique(new_tablet_schema->create_block());
auto ref_block = vectorized::Block::create_unique(base_tablet_schema->create_block());

Expand Down Expand Up @@ -578,7 +585,14 @@ Status VBaseSchemaChangeWithSorting::_inner_process(RowsetReaderSharedPtr rowset
auto new_block = vectorized::Block::create_unique(new_tablet_schema->create_block());

bool eof = false;
int64_t tablet_id = new_tablet->tablet_id();
do {
// tablet may be dropped due to user cancel, schema change thread should fast fail
// and release tablet lock.
if (StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id) == nullptr) {
return Status::Error<TABLE_NOT_FOUND>("fail to find tablet. tablet_id={}",
tablet_id);
}
auto ref_block = vectorized::Block::create_unique(base_tablet_schema->create_block());
auto st = rowset_reader->next_block(ref_block.get());
if (!st) {
Expand Down

0 comments on commit 3e48d2a

Please sign in to comment.