fix update store_col_cnt when upgrade
This commit is contained in:
@ -389,8 +389,8 @@ int ObTabletMediumCompactionInfoRecorder::submit_log(
|
||||
LOG_ERROR("failed to dec ref on memtable", K(tmp_ret), K_(ls_id), K_(tablet_id));
|
||||
}
|
||||
} else {
|
||||
LOG_INFO("success to submit medium log", K(ret), K_(tablet_id), K(medium_info_), K_(clog_scn),
|
||||
"max_saved_version", get_max_saved_version());
|
||||
LOG_INFO("success to submit medium log", K(ret), K_(ls_id), K_(tablet_id), K(medium_info_),
|
||||
K_(clog_scn), "max_saved_version", get_max_saved_version());
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@ -1109,9 +1109,7 @@ int ObTabletMergeCtx::get_storage_schema_to_merge(const ObTablesHandleArray &mer
|
||||
storage_schema = nullptr;
|
||||
} else {
|
||||
// only update column cnt by memtable, use schema version on tablet_schema
|
||||
storage_schema->column_cnt_ = MAX(storage_schema->column_cnt_, max_column_cnt_on_recorder);
|
||||
storage_schema->column_cnt_ = MAX(storage_schema->column_cnt_, max_column_cnt_in_memtable);
|
||||
storage_schema->store_column_cnt_ = MAX(column_cnt_in_schema, max_column_cnt_in_memtable);
|
||||
storage_schema->update_column_cnt(MAX(max_column_cnt_on_recorder, max_column_cnt_in_memtable));
|
||||
storage_schema->schema_version_ = MAX(max_schema_version_in_memtable, schema_on_tablet->get_schema_version());
|
||||
schema_ctx_.storage_schema_ = storage_schema;
|
||||
use_schema_on_tablet = false;
|
||||
|
||||
@ -993,5 +993,11 @@ void ObStorageSchema::reset_string(ObString &str)
|
||||
str.reset();
|
||||
}
|
||||
|
||||
void ObStorageSchema::update_column_cnt(const int64_t input_col_cnt)
|
||||
{
|
||||
column_cnt_ = MAX(column_cnt_, input_col_cnt);
|
||||
store_column_cnt_ = MAX(store_column_cnt_, input_col_cnt);
|
||||
}
|
||||
|
||||
} // namespace storage
|
||||
} // namespace oceanbase
|
||||
|
||||
@ -132,6 +132,7 @@ public:
|
||||
const int64_t data_len,
|
||||
int64_t &pos);
|
||||
int64_t get_serialize_size() const;
|
||||
void update_column_cnt(const int64_t input_col_cnt);
|
||||
|
||||
// for new mds
|
||||
int assign(common::ObIAllocator &allocator, const ObStorageSchema &other);
|
||||
|
||||
@ -151,17 +151,18 @@ int ObStorageSchemaRecorder::inner_replay_clog(
|
||||
if (OB_OBSOLETE_CLOG_NEED_SKIP == ret) {
|
||||
ret = OB_SUCCESS;
|
||||
} else {
|
||||
LOG_WARN("failed to get tablet handle", K(ret), K_(tablet_id), K(scn));
|
||||
LOG_WARN("failed to get tablet handle", K(ret), K_(ls_id), K_(tablet_id), K(scn));
|
||||
}
|
||||
} else if (OB_FAIL(replay_storage_schema.deserialize(tmp_allocator, buf, size, pos))) {
|
||||
LOG_WARN("fail to deserialize table schema", K(ret), K_(tablet_id));
|
||||
LOG_WARN("fail to deserialize table schema", K(ret), K_(ls_id), K_(tablet_id));
|
||||
} else if (OB_FAIL(replay_storage_schema.get_store_column_count(stored_col_cnt, true/*full_col*/))) {
|
||||
LOG_WARN("failed to get store column count from replay schema", KR(ret),K(replay_storage_schema));
|
||||
} else {
|
||||
// replay schema clog and update to ObStorageSchemaRecorder
|
||||
// need get column_cnt on schema_recorder to mini merge
|
||||
max_column_cnt_ = MAX(max_column_cnt_, stored_col_cnt);
|
||||
FLOG_INFO("success to replay schema clog", K(ret), K(replay_storage_schema), K(stored_col_cnt), K(max_column_cnt_));
|
||||
FLOG_INFO("success to replay schema clog", K(ret), K_(ls_id), K_(tablet_id), K(replay_storage_schema),
|
||||
K(stored_col_cnt), K(max_column_cnt_));
|
||||
}
|
||||
replay_storage_schema.reset();
|
||||
tmp_tablet_handle.reset();
|
||||
|
||||
@ -4657,8 +4657,7 @@ int ObTablet::get_storage_schema_for_transfer_in(
|
||||
} else {
|
||||
int64_t old_column_cnt = storage_schema.get_column_count();
|
||||
int64_t old_schema_version = storage_schema.get_schema_version();
|
||||
storage_schema.column_cnt_ = MAX(old_column_cnt, max_column_cnt_in_memtable);
|
||||
storage_schema.store_column_cnt_ = MAX(store_column_cnt_in_schema, max_column_cnt_in_memtable);
|
||||
storage_schema.update_column_cnt(max_column_cnt_in_memtable);
|
||||
storage_schema.schema_version_ = MAX(old_schema_version, max_schema_version_in_memtable);
|
||||
LOG_INFO("succeeded to get storage schema from transfer source tablet", K(ret), K(storage_schema), K(max_column_cnt_in_memtable),
|
||||
K(max_schema_version_in_memtable), K(old_column_cnt), K(store_column_cnt_in_schema), K(old_schema_version));
|
||||
|
||||
Reference in New Issue
Block a user