diff --git a/src/share/scn.cpp b/src/share/scn.cpp index aa77d86e83a3a6d7f2aedae8b53ad40ae87b5464..cd26ddabae8123f1dc38179634730793d712386b 100644 --- a/src/share/scn.cpp +++ b/src/share/scn.cpp @@ -363,11 +363,15 @@ int SCN::convert_for_tx(int64_t val) return ret; } -int64_t SCN::get_val_for_tx() const +int64_t SCN::get_val_for_tx(const bool ignore_invalid_scn) const { - int64_t result_val = 0; + int64_t result_val = -1; if (!is_valid()) { - PALF_LOG(ERROR, "invalid SCN", K(val_)); + if (!ignore_invalid_scn) { + PALF_LOG(ERROR, "invalid SCN", K(val_)); + } else { + PALF_LOG(WARN, "invalid SCN", K(val_)); + } } else if (OB_MAX_SCN_TS_NS == ts_ns_) { result_val = INT64_MAX; } else { diff --git a/src/share/scn.h b/src/share/scn.h index 07da1b60be405d0d4ec3fbabbeb1896945a31dfb..396321d1a2d77851373525c62bde876aa924ae5d 100644 --- a/src/share/scn.h +++ b/src/share/scn.h @@ -96,7 +96,7 @@ public: uint64_t get_val_for_sql() const; //only for tx, include transform from SCN_MAX to INT64_MAX - int64_t get_val_for_tx() const; + int64_t get_val_for_tx(const bool ignore_invalid_scn = false) const; // compare function bool operator==(const SCN &scn) const; diff --git a/src/storage/tx/ob_keep_alive_ls_handler.cpp b/src/storage/tx/ob_keep_alive_ls_handler.cpp index 540b78749e276c86057083518b23f887c2857972..2beb5cfb915210fd3015968f2ef46ff6c12ab364 100644 --- a/src/storage/tx/ob_keep_alive_ls_handler.cpp +++ b/src/storage/tx/ob_keep_alive_ls_handler.cpp @@ -204,10 +204,10 @@ void ObKeepAliveLSHandler::print_stat_info() "Near_To_GTS_Cnt", stat_info_.near_to_gts_cnt, "Other_Error_Cnt", stat_info_.other_error_cnt, "Submit_Succ_Cnt", stat_info_.submit_succ_cnt, - "last_scn", stat_info_.stat_keepalive_info_.scn_.get_val_for_tx(), + "last_scn", to_cstring(stat_info_.stat_keepalive_info_.scn_), "last_lsn", stat_info_.stat_keepalive_info_.lsn_, "last_gts", last_gts_, - "min_start_scn", stat_info_.stat_keepalive_info_.min_start_scn_.get_val_for_tx(), + "min_start_scn", to_cstring(stat_info_.stat_keepalive_info_.min_start_scn_), "min_start_status", stat_info_.stat_keepalive_info_.min_start_status_); stat_info_.clear_cnt(); }