Fix backup check major version with minor sstable continues bug
This commit is contained in:
@ -2103,7 +2103,11 @@ int ObBackupTabletProvider::check_tablet_continuity_(const share::ObLSID &ls_id,
|
|||||||
const ObTabletMeta &cur_tablet_meta = tablet_handle.get_obj()->get_tablet_meta();
|
const ObTabletMeta &cur_tablet_meta = tablet_handle.get_obj()->get_tablet_meta();
|
||||||
const int64_t cur_snapshot_version = cur_tablet_meta.report_status_.merge_snapshot_version_;
|
const int64_t cur_snapshot_version = cur_tablet_meta.report_status_.merge_snapshot_version_;
|
||||||
const int64_t prev_backup_snapshot_version = prev_backup_tablet_meta.tablet_meta_.report_status_.merge_snapshot_version_;
|
const int64_t prev_backup_snapshot_version = prev_backup_tablet_meta.tablet_meta_.report_status_.merge_snapshot_version_;
|
||||||
if (cur_snapshot_version < prev_backup_snapshot_version) {
|
if ((prev_backup_snapshot_version <= 0 && prev_backup_tablet_meta.tablet_meta_.table_store_flag_.with_major_sstable())
|
||||||
|
|| (cur_snapshot_version <= 0 && cur_tablet_meta.table_store_flag_.with_major_sstable())) {
|
||||||
|
ret = OB_ERR_UNEXPECTED;
|
||||||
|
LOG_WARN("prev or current snapshot version should not be invalid", K(ret), K(cur_tablet_meta), K(prev_backup_tablet_meta));
|
||||||
|
} else if (cur_snapshot_version < prev_backup_snapshot_version) {
|
||||||
ret = OB_BACKUP_MAJOR_NOT_COVER_MINOR;
|
ret = OB_BACKUP_MAJOR_NOT_COVER_MINOR;
|
||||||
LOG_WARN("tablet is not valid", K(ret), K(cur_tablet_meta), K(prev_backup_tablet_meta));
|
LOG_WARN("tablet is not valid", K(ret), K(cur_tablet_meta), K(prev_backup_tablet_meta));
|
||||||
} else {
|
} else {
|
||||||
|
@ -2138,7 +2138,8 @@ int ObTablet::try_update_table_store_flag(const ObUpdateTableStoreParam ¶m)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObTablet::build_migration_tablet_param(ObMigrationTabletParam &mig_tablet_param) const
|
int ObTablet::build_migration_tablet_param(
|
||||||
|
ObMigrationTabletParam &mig_tablet_param) const
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
|
|
||||||
@ -2168,7 +2169,7 @@ int ObTablet::build_migration_tablet_param(ObMigrationTabletParam &mig_tablet_pa
|
|||||||
mig_tablet_param.ddl_execution_id_ = tablet_meta_.ddl_execution_id_;
|
mig_tablet_param.ddl_execution_id_ = tablet_meta_.ddl_execution_id_;
|
||||||
mig_tablet_param.ddl_data_format_version_ = tablet_meta_.ddl_data_format_version_;
|
mig_tablet_param.ddl_data_format_version_ = tablet_meta_.ddl_data_format_version_;
|
||||||
mig_tablet_param.ddl_commit_scn_ = tablet_meta_.ddl_commit_scn_;
|
mig_tablet_param.ddl_commit_scn_ = tablet_meta_.ddl_commit_scn_;
|
||||||
mig_tablet_param.report_status_.reset();
|
mig_tablet_param.report_status_ = tablet_meta_.report_status_;
|
||||||
|
|
||||||
if (OB_FAIL(mig_tablet_param.storage_schema_.init(mig_tablet_param.allocator_, storage_schema_))) {
|
if (OB_FAIL(mig_tablet_param.storage_schema_.init(mig_tablet_param.allocator_, storage_schema_))) {
|
||||||
LOG_WARN("failed to copy storage schema", K(ret), K_(tablet_meta));
|
LOG_WARN("failed to copy storage schema", K(ret), K_(tablet_meta));
|
||||||
|
@ -287,7 +287,8 @@ public:
|
|||||||
|
|
||||||
// migration section
|
// migration section
|
||||||
// used for migration source generating create tablet rpc argument
|
// used for migration source generating create tablet rpc argument
|
||||||
int build_migration_tablet_param(ObMigrationTabletParam &mig_tablet_param) const;
|
int build_migration_tablet_param(
|
||||||
|
ObMigrationTabletParam &mig_tablet_param) const;
|
||||||
int build_migration_sstable_param(
|
int build_migration_sstable_param(
|
||||||
const ObITable::TableKey &table_key,
|
const ObITable::TableKey &table_key,
|
||||||
blocksstable::ObMigrationSSTableParam &mig_sstable_param) const;
|
blocksstable::ObMigrationSSTableParam &mig_sstable_param) const;
|
||||||
|
@ -235,7 +235,7 @@ int ObTabletMeta::init(
|
|||||||
snapshot_version_ = param.snapshot_version_;
|
snapshot_version_ = param.snapshot_version_;
|
||||||
multi_version_start_ = param.multi_version_start_;
|
multi_version_start_ = param.multi_version_start_;
|
||||||
compat_mode_ = param.compat_mode_;
|
compat_mode_ = param.compat_mode_;
|
||||||
report_status_ = param.report_status_;
|
report_status_.reset();
|
||||||
tx_data_ = param.tx_data_;
|
tx_data_ = param.tx_data_;
|
||||||
table_store_flag_ = param.table_store_flag_;
|
table_store_flag_ = param.table_store_flag_;
|
||||||
ddl_start_scn_ = param.ddl_start_scn_;
|
ddl_start_scn_ = param.ddl_start_scn_;
|
||||||
|
Reference in New Issue
Block a user