fix ddl while migration not allow duplicate sstable issue
This commit is contained in:
		| @ -1398,7 +1398,8 @@ int ObTabletCopyFinishTask::inner_update_tablet_table_store_with_major_( | ||||
|                             ls_->get_rebuild_seq(), | ||||
|                             true/*need_report*/, | ||||
|                             SCN::min_scn()/*clog_checkpoint_scn*/, | ||||
|                             true/*need_check_sstable*/); | ||||
|                             true/*need_check_sstable*/, | ||||
|                             true/*allow_duplicate_sstable*/); | ||||
|     if (tablet->get_storage_schema().get_version() < src_tablet_meta_->storage_schema_.get_version()) { | ||||
|       SERVER_EVENT_ADD("storage_ha", "schema_change_need_merge_tablet_meta", | ||||
|                       "tenant_id", MTL_ID(), | ||||
|  | ||||
| @ -224,6 +224,7 @@ ObUpdateTableStoreParam::ObUpdateTableStoreParam( | ||||
|     ddl_snapshot_version_(0), | ||||
|     ddl_execution_id_(0), | ||||
|     ddl_cluster_version_(0), | ||||
|     allow_duplicate_sstable_(false), | ||||
|     tx_data_(), | ||||
|     binding_info_(), | ||||
|     auto_inc_seq_() | ||||
| @ -239,7 +240,8 @@ ObUpdateTableStoreParam::ObUpdateTableStoreParam( | ||||
|     const int64_t rebuild_seq, | ||||
|     const bool need_report, | ||||
|     const SCN clog_checkpoint_scn, | ||||
|     const bool need_check_sstable) | ||||
|     const bool need_check_sstable, | ||||
|     const bool allow_duplicate_sstable) | ||||
|   : table_handle_(table_handle), | ||||
|     snapshot_version_(snapshot_version), | ||||
|     clog_checkpoint_scn_(), | ||||
| @ -255,6 +257,7 @@ ObUpdateTableStoreParam::ObUpdateTableStoreParam( | ||||
|     ddl_snapshot_version_(0), | ||||
|     ddl_execution_id_(0), | ||||
|     ddl_cluster_version_(0), | ||||
|     allow_duplicate_sstable_(allow_duplicate_sstable), | ||||
|     tx_data_(), | ||||
|     binding_info_(), | ||||
|     auto_inc_seq_() | ||||
| @ -285,6 +288,7 @@ ObUpdateTableStoreParam::ObUpdateTableStoreParam( | ||||
|     ddl_snapshot_version_(0), | ||||
|     ddl_execution_id_(0), | ||||
|     ddl_cluster_version_(0), | ||||
|     allow_duplicate_sstable_(false), | ||||
|     tx_data_(), | ||||
|     binding_info_(), | ||||
|     auto_inc_seq_() | ||||
|  | ||||
| @ -305,7 +305,8 @@ struct ObUpdateTableStoreParam | ||||
|     const int64_t rebuild_seq, | ||||
|     const bool need_report = false, | ||||
|     const share::SCN clog_checkpoint_scn = share::SCN::min_scn(), | ||||
|     const bool need_check_sstable = false); | ||||
|     const bool need_check_sstable = false, | ||||
|     const bool allow_duplicate_sstable = false); | ||||
|  | ||||
|   ObUpdateTableStoreParam( // for ddl merge task only | ||||
|     const ObTableHandleV2 &table_handle, | ||||
| @ -320,7 +321,7 @@ struct ObUpdateTableStoreParam | ||||
|   TO_STRING_KV(K_(table_handle), K_(snapshot_version), K_(clog_checkpoint_scn), K_(multi_version_start), | ||||
|                K_(keep_old_ddl_sstable), K_(need_report), KPC_(storage_schema), K_(rebuild_seq), K_(update_with_major_flag), | ||||
|                K_(need_check_sstable), K_(ddl_checkpoint_scn), K_(ddl_start_scn), K_(ddl_snapshot_version), | ||||
|                K_(ddl_execution_id), K_(ddl_cluster_version), K_(tx_data), K_(binding_info), K_(auto_inc_seq)); | ||||
|                K_(ddl_execution_id), K_(ddl_cluster_version), K_(allow_duplicate_sstable), K_(tx_data), K_(binding_info), K_(auto_inc_seq)); | ||||
|  | ||||
|   ObTableHandleV2 table_handle_; | ||||
|   int64_t snapshot_version_; | ||||
| @ -337,6 +338,7 @@ struct ObUpdateTableStoreParam | ||||
|   int64_t ddl_snapshot_version_; | ||||
|   int64_t ddl_execution_id_; | ||||
|   int64_t ddl_cluster_version_; | ||||
|   bool allow_duplicate_sstable_; | ||||
|  | ||||
|   // msd | ||||
|   ObTabletTxMultiSourceDataUnit tx_data_; | ||||
|  | ||||
| @ -773,11 +773,10 @@ int ObTabletTableStore::build_major_tables( | ||||
|   inc_base_snapshot_version = -1; | ||||
|   ObITable *new_table = const_cast<ObITable *>(param.table_handle_.get_table()); //table can be null | ||||
|   ObTablesHandleArray tables_handle; | ||||
|   const bool allow_duplicate_sstable = false; | ||||
|   if (OB_NOT_NULL(new_table) && OB_FAIL(tables_handle.add_table(new_table))) { | ||||
|     LOG_WARN("failed to add table into tables handle", K(ret), K(param)); | ||||
|   } else if (OB_FAIL(inner_build_major_tables_(allocator, old_store, tables_handle, | ||||
|       param.multi_version_start_, allow_duplicate_sstable, inc_base_snapshot_version))) { | ||||
|       param.multi_version_start_, param.allow_duplicate_sstable_, inc_base_snapshot_version))) { | ||||
|     LOG_WARN("failed to inner build major tables", K(ret), K(param), K(tables_handle)); | ||||
|   } | ||||
|   return ret; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 oceanoverflow
					oceanoverflow