提交 8dddff22 编写于 作者: Y YoungYang0820 提交者: wangzelin.wzl

fix unexpected error log in ObMacroBlockWriter when creating unique index

上级 a1b06baa
......@@ -264,6 +264,7 @@ void ObDataStoreDesc::reset()
progressive_merge_round_ = 0;
major_working_cluster_version_ = 0;
iter_complement_ = false;
is_unique_index_ = false;
}
int ObDataStoreDesc::assign(const ObDataStoreDesc& desc)
......@@ -303,6 +304,7 @@ int ObDataStoreDesc::assign(const ObDataStoreDesc& desc)
pg_key_ = desc.pg_key_;
need_check_order_ = desc.need_check_order_;
major_working_cluster_version_ = desc.major_working_cluster_version_;
is_unique_index_ = desc.is_unique_index_;
if (OB_FAIL(file_handle_.assign(desc.file_handle_))) {
STORAGE_LOG(WARN, "failed to assign file handle", K(ret), K(desc.file_handle_));
}
......
......@@ -74,6 +74,7 @@ struct ObDataStoreDesc {
// which still use freezeinfo without cluster version
int64_t major_working_cluster_version_;
bool iter_complement_;
bool is_unique_index_;
common::ObArenaAllocator allocator_;
ObDataStoreDesc()
......@@ -103,7 +104,7 @@ struct ObDataStoreDesc {
K_(store_micro_block_column_checksum), K_(snapshot_version), K_(need_calc_physical_checksum), K_(need_index_tree),
K_(need_prebuild_bloomfilter), K_(bloomfilter_rowkey_prefix), KP_(rowkey_helper), "column_types",
common::ObArrayWrap<common::ObObjMeta>(column_types_, row_column_count_), K_(pg_key), K_(file_handle),
K_(need_check_order), K_(need_index_tree), K_(major_working_cluster_version), K_(iter_complement));
K_(need_check_order), K_(need_index_tree), K_(major_working_cluster_version), K_(iter_complement), K_(is_unique_index));
private:
int cal_row_store_type(const share::schema::ObTableSchema& table_schema, const storage::ObMergeType merge_type);
......
......@@ -851,7 +851,12 @@ int ObMacroBlockWriter::check_order(const ObStoreRow& row)
} else {
// baseline data
ret = OB_ERR_PRIMARY_KEY_DUPLICATE;
STORAGE_LOG(ERROR, "input rowkey is equal with last rowkey", K(cur_key), K(last_key), K(ret));
if (data_store_desc_->is_unique_index_) {
STORAGE_LOG(
WARN, "input rowkey is equal with last rowkey in unique index", K(cur_key), K(last_key), K(ret));
} else {
STORAGE_LOG(ERROR, "input rowkey is equal with last rowkey", K(cur_key), K(last_key), K(ret));
}
}
} else {
// normal case
......
......@@ -825,6 +825,7 @@ int ObIndexMergeTask::add_build_index_sstable(const ObBuildIndexParam& param,
pg->get_partition_key(),
pg->get_storage_file_handle()))) {
STORAGE_LOG(WARN, "Fail to init data store desc, ", K(ret));
} else if (FALSE_IT(data_desc_.is_unique_index_ = param.index_schema_->is_unique_index())) {
} else if (OB_FAIL(writer_.open(data_desc_, macro_start_seq))) {
STORAGE_LOG(WARN, "Fail to open macro block writer, ", K(ret));
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册