提交 5b5c04ff 编写于 作者: O obdev 提交者: wangzelin.wzl

cherry-pick from 3_1_x_release to 3.1_opensource_release

上级 1777c976
......@@ -920,7 +920,6 @@ int ObService::submit_pt_update_task(
{
int ret = OB_SUCCESS;
const bool is_remove = false;
const int64_t version = 0;
const ObSSTableChecksumUpdateType update_type = ObSSTableChecksumUpdateType::UPDATE_ALL;
if (!inited_) {
ret = OB_NOT_INIT;
......@@ -930,12 +929,35 @@ int ObService::submit_pt_update_task(
LOG_WARN("invalid argument", K(part_key), K(ret));
} else if (OB_FAIL(partition_table_updater_.async_update(part_key, with_role))) {
LOG_WARN("async_update failed", K(part_key), K(ret));
} else if (need_report_checksum && !part_key.is_pg() &&
OB_FAIL(checksum_updater_.add_task(part_key, is_remove, update_type))) {
LOG_WARN("fail to async update sstable checksum", K(ret));
} else {
// do nothing
} else if (need_report_checksum) {
if (part_key.is_pg()) {
ObPartitionArray pkeys;
ObIPartitionGroupGuard guard;
if (OB_FAIL(gctx_.par_ser_->get_partition(part_key, guard))) {
if (OB_PARTITION_NOT_EXIST == ret) {
ret = OB_SUCCESS;
} else {
LOG_WARN("fail to get partition", K(ret), K(part_key));
}
} else if (OB_ISNULL(guard.get_partition_group())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("error unexpected, partition must not be NULL", K(ret));
} else if (OB_FAIL(guard.get_partition_group()->get_all_pg_partition_keys(pkeys))) {
LOG_WARN("get pg partition fail", K(ret), K(part_key));
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < pkeys.count(); ++i) {
if (OB_FAIL(checksum_updater_.add_task(pkeys.at(i), is_remove, update_type))) {
LOG_WARN("failt to async update sstable checksum", K(ret), K(pkeys.at(i)));
}
}
}
} else {
if (OB_FAIL(checksum_updater_.add_task(part_key, is_remove, update_type))) {
LOG_WARN("fail to async update sstable checksum", K(ret));
}
}
}
return ret;
}
......
......@@ -1432,9 +1432,6 @@ int ObMultiVersionTableStore::get_schema_version(int64_t& schema_version)
if (OB_FAIL(table_store->get_schema_version(schema_version))) {
LOG_WARN("failed to get_schema_version", K(ret));
}
} else if (create_schema_version_ <= 0) {
ret = OB_ERR_SYS;
LOG_WARN("create_schema_version should be valid when no table exist", K(ret));
} else {
schema_version = create_schema_version_;
}
......
......@@ -112,6 +112,7 @@ public:
int set_drop_schema_info(const int64_t drop_schema_version);
int get_drop_schema_info(int64_t& drop_schema_version, int64_t& drop_schema_refreshed_ts);
int get_recovery_point_tables(const int64_t snapshot_version, ObTablesHandle& handle);
void set_create_schema_version(const int64_t schema_version) { create_schema_version_ = schema_version; }
DECLARE_VIRTUAL_TO_STRING;
......
......@@ -749,7 +749,16 @@ int ObPartitionStore::create_multi_version_store_(
if (OB_HASH_EXIST != ret) {
LOG_WARN("failed to set table store to map", K(ret), K(table_id));
} else {
ret = OB_ENTRY_EXIST;
ObMultiVersionTableStore *get_table_store = nullptr;
if (OB_FAIL(store_map_->get(table_id, get_table_store))) {
LOG_WARN("get store map failed", K(ret), K(table_id));
} else if (OB_ISNULL(get_table_store)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("error unexpected, get table store must not be nullptr", K(ret));
} else {
get_table_store->set_create_schema_version(schema_version);
ret = OB_ENTRY_EXIST;
}
}
} else {
LOG_INFO("succeed to create multi version table store", KPC(tmp_table_store), KP(tmp_table_store), K(table_id));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册