From 0385f460a4b82acbabd8940d0297ff32e5383cf3 Mon Sep 17 00:00:00 2001 From: godyangfight Date: Thu, 8 Feb 2024 09:50:27 +0000 Subject: [PATCH] [CP] Fix 421->422 migrate/rebuild copy sstable compatible bug. --- .../ob_storage_ha_tablet_builder.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/storage/high_availability/ob_storage_ha_tablet_builder.cpp b/src/storage/high_availability/ob_storage_ha_tablet_builder.cpp index e94df9233..e3b97b635 100644 --- a/src/storage/high_availability/ob_storage_ha_tablet_builder.cpp +++ b/src/storage/high_availability/ob_storage_ha_tablet_builder.cpp @@ -913,7 +913,6 @@ int ObStorageHATabletsBuilder::get_minor_scn_range_( { int ret = OB_SUCCESS; scn_range.reset(); - ObArray sstables; scn_range.start_scn_ = ObTabletMeta::INIT_CLOG_CHECKPOINT_SCN; scn_range.end_scn_ = ObTabletMeta::INIT_CLOG_CHECKPOINT_SCN; @@ -941,8 +940,14 @@ int ObStorageHATabletsBuilder::get_minor_scn_range_( if (OB_SUCC(ret)) { //need copy src all minor sstables for tablet meta merge, do not need calculate sstable version range. - scn_range.start_scn_.set_base(); - scn_range.end_scn_.set_max(); + //here set end scn just for compatible + if (GET_MIN_CLUSTER_VERSION() <= CLUSTER_VERSION_4_2_1_1) { + scn_range.start_scn_ = ObTabletMeta::INIT_CLOG_CHECKPOINT_SCN; + scn_range.end_scn_ = sstables.empty() ? tablet->get_tablet_meta().clog_checkpoint_scn_ : sstables.at(0).get_sstable()->get_start_scn(); + } else { + scn_range.start_scn_.set_base(); + scn_range.end_scn_.set_max(); + } } } return ret;