Fix ls migration tablet meta merge with clog_checkpoint_ts

This commit is contained in:
godyangfight
2022-11-10 02:37:27 +00:00
committed by wangzelin.wzl
parent ad1c2616f6
commit 27459b3e05
13 changed files with 141 additions and 76 deletions

View File

@ -257,11 +257,28 @@ int ObTabletMeta::init(
const int64_t max_sync_storage_schema_version = OB_ISNULL(tablet_meta) ?
old_tablet_meta.max_sync_storage_schema_version_ : MIN(old_tablet_meta.max_sync_storage_schema_version_,
tablet_meta->max_sync_storage_schema_version_);
const int64_t clog_checkpoint_ts = OB_ISNULL(tablet_meta) ?
old_tablet_meta.clog_checkpoint_ts_ : MAX(old_tablet_meta.clog_checkpoint_ts_, tablet_meta->clog_checkpoint_ts_);
ObTabletTableStoreFlag table_store_flag = old_tablet_meta.table_store_flag_;
if (!table_store_flag.with_major_sstable()) {
table_store_flag = OB_ISNULL(tablet_meta) ? table_store_flag : tablet_meta->table_store_flag_;
}
if (OB_NOT_NULL(tablet_meta) && tablet_meta->clog_checkpoint_ts_ > old_tablet_meta.clog_checkpoint_ts_) {
if (OB_FAIL(autoinc_seq_.assign(tablet_meta->autoinc_seq_))) {
LOG_WARN("failed to assign autoinc seq", K(ret));
} else {
tx_data_ = tablet_meta->tx_data_;
}
} else {
if (OB_FAIL(autoinc_seq_.assign(autoinc_seq))) {
LOG_WARN("failed to assign autoinc seq", K(ret));
} else {
tx_data_ = tx_data;
}
}
version_ = TABLET_META_VERSION;
ls_id_ = old_tablet_meta.ls_id_;
tablet_id_ = old_tablet_meta.tablet_id_;
@ -269,17 +286,13 @@ int ObTabletMeta::init(
ref_tablet_id_ = old_tablet_meta.ref_tablet_id_;
create_scn_ = old_tablet_meta.create_scn_;
start_scn_ = old_tablet_meta.start_scn_;
clog_checkpoint_ts_ = old_tablet_meta.clog_checkpoint_ts_;
clog_checkpoint_ts_ = clog_checkpoint_ts;
ddl_checkpoint_ts_ = old_tablet_meta.ddl_checkpoint_ts_;
snapshot_version_ = snapshot_version;
multi_version_start_ = multi_version_start;
compat_mode_ = old_tablet_meta.compat_mode_;
if (FAILEDx(autoinc_seq_.assign(autoinc_seq))) {
LOG_WARN("failed to assign autoinc seq", K(ret));
}
ha_status_ = old_tablet_meta.ha_status_;
report_status_ = old_tablet_meta.report_status_;
tx_data_ = tx_data;
report_status_ = old_tablet_meta.report_status_; //old tablet meta report status already reset
if (FAILEDx(ddl_data_.assign(ddl_data))) {
LOG_WARN("failed to assign ddl data", K(ret));
}