From 0d37562338daa11b74f2cb2ef5d07e982c2e50b4 Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 15 Nov 2022 12:10:21 +0000 Subject: [PATCH] fix bug: multi-insert all_column_checksum_error_info --- src/rootserver/freeze/ob_checksum_validator.cpp | 4 ++-- src/rootserver/freeze/ob_major_merge_scheduler.cpp | 1 - src/share/ob_column_checksum_error_operator.cpp | 7 +++++-- src/share/ob_tablet_replica_checksum_operator.cpp | 6 ++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/rootserver/freeze/ob_checksum_validator.cpp b/src/rootserver/freeze/ob_checksum_validator.cpp index 742b47a93e..519b4fe987 100644 --- a/src/rootserver/freeze/ob_checksum_validator.cpp +++ b/src/rootserver/freeze/ob_checksum_validator.cpp @@ -322,8 +322,8 @@ int ObIndexChecksumValidator::do_check(const ObSimpleFrozenStatus &frozen_status if (FAILEDx(ObTabletReplicaChecksumOperator::check_column_checksum(tenant_id_, *data_table_schema, *index_table_schema, frozen_status.frozen_scn_, *sql_proxy_))) { if (OB_CHECKSUM_ERROR == ret) { - LOG_ERROR("ERROR! ERROR! ERROR! checksum error in index checksum", KR(ret), K(*data_table_schema), K(*index_table_schema), - K_(tenant_id), K(frozen_status)); + LOG_ERROR("ERROR! ERROR! ERROR! checksum error in index checksum", KR(ret), K_(tenant_id), + K(frozen_status), K(*data_table_schema), K(*index_table_schema)); check_ret = OB_CHECKSUM_ERROR; ret = OB_SUCCESS; // continue checking next checksum } else if (OB_EAGAIN != ret) { diff --git a/src/rootserver/freeze/ob_major_merge_scheduler.cpp b/src/rootserver/freeze/ob_major_merge_scheduler.cpp index 8f4a34abb1..903c07fbe9 100644 --- a/src/rootserver/freeze/ob_major_merge_scheduler.cpp +++ b/src/rootserver/freeze/ob_major_merge_scheduler.cpp @@ -631,7 +631,6 @@ int ObMajorMergeScheduler::update_merge_status(const int64_t expected_epoch) } } } - } } } diff --git a/src/share/ob_column_checksum_error_operator.cpp b/src/share/ob_column_checksum_error_operator.cpp index cce46018bf..ae5433cc9b 100644 --- a/src/share/ob_column_checksum_error_operator.cpp +++ b/src/share/ob_column_checksum_error_operator.cpp @@ -87,9 +87,12 @@ int ObColumnChecksumErrorOperator::insert_column_checksum_err_info_( LOG_WARN("fail to add pk column", KR(ret), K(tenant_id), K(info)); } else if (OB_FAIL(exec.exec_insert_update(OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_TNAME, dml, affected_rows))) { LOG_WARN("fail to splice exec_insert_update", KR(ret), K(meta_tenant_id), K(info)); - } else if (!is_single_row(affected_rows)) { + } else if (affected_rows < 0 || affected_rows > 2) { + // one ckm_error info may insert multi-times due to verifying checksum multi-times. if re-insert, cuz we + // use 'on duplicate key update', the 'affected_rows' may be 0(not pk_column values unchanged) + // or 2(not pk_column values changed) ret = OB_ERR_UNEXPECTED; - LOG_ERROR("unexpected affected rows", KR(ret), K(affected_rows), K(meta_tenant_id), K(info)); + LOG_WARN("unexpected affected rows", KR(ret), K(affected_rows)); } return ret; } diff --git a/src/share/ob_tablet_replica_checksum_operator.cpp b/src/share/ob_tablet_replica_checksum_operator.cpp index 76c67ed34d..0d78535333 100644 --- a/src/share/ob_tablet_replica_checksum_operator.cpp +++ b/src/share/ob_tablet_replica_checksum_operator.cpp @@ -879,14 +879,12 @@ int ObTabletReplicaChecksumOperator::check_column_checksum( if (is_global_index) { if (OB_FAIL(check_global_index_column_checksum(tenant_id, data_table_schema, index_table_schema, global_snapshot_version, sql_proxy))) { - LOG_WARN("fail to check global index column checksum", KR(ret), K(data_table_schema), - K(index_table_schema), K(global_snapshot_version)); + LOG_WARN("fail to check global index column checksum", KR(ret), K(tenant_id), K(global_snapshot_version)); } } else { if (OB_FAIL(check_local_index_column_checksum(tenant_id, data_table_schema, index_table_schema, global_snapshot_version, sql_proxy))) { - LOG_WARN("fail to check local index column checksum", KR(ret), K(data_table_schema), - K(index_table_schema), K(global_snapshot_version)); + LOG_WARN("fail to check local index column checksum", KR(ret), K(tenant_id), K(global_snapshot_version)); } } }