From 12edc62dbcd06f77bc67a56ef8f88fdc9cee0127 Mon Sep 17 00:00:00 2001 From: renju96 Date: Thu, 10 Aug 2023 11:42:28 +0000 Subject: [PATCH] larger ddl_redo_log write timeout --- src/storage/ddl/ob_ddl_redo_log_writer.cpp | 27 +++++++++++++++++----- src/storage/ddl/ob_ddl_redo_log_writer.h | 2 +- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/storage/ddl/ob_ddl_redo_log_writer.cpp b/src/storage/ddl/ob_ddl_redo_log_writer.cpp index 2f7172a302..c75d01ba2f 100755 --- a/src/storage/ddl/ob_ddl_redo_log_writer.cpp +++ b/src/storage/ddl/ob_ddl_redo_log_writer.cpp @@ -818,7 +818,9 @@ int ObDDLRedoLogWriter::write_ddl_start_log(ObTabletHandle &tablet_handle, bool finish = false; const int64_t start_time = ObTimeUtility::current_time(); while (OB_SUCC(ret) && !finish) { - if (tmp_cb->is_success()) { + if (OB_FAIL(THIS_WORKER.check_status())) { + LOG_WARN("check status failed", K(ret)); + } else if (tmp_cb->is_success()) { finish = true; } else if (tmp_cb->is_failed()) { ret = OB_NOT_MASTER; @@ -827,8 +829,11 @@ int ObDDLRedoLogWriter::write_ddl_start_log(ObTabletHandle &tablet_handle, const int64_t current_time = ObTimeUtility::current_time(); if (current_time - start_time > ObDDLRedoLogHandle::DDL_REDO_LOG_TIMEOUT) { ret = OB_TIMEOUT; - LOG_WARN("write ddl start log timeout", K(ret)); + LOG_WARN("write ddl start log timeout", K(ret), K(current_time), K(start_time)); } else { + if (REACH_TIME_INTERVAL(10L * 1000L * 1000L)) { //10s + LOG_INFO("wait ddl start log callback", K(ret), K(finish), K(current_time), K(start_time)); + } ob_usleep(ObDDLRedoLogHandle::CHECK_DDL_REDO_LOG_FINISH_INTERVAL); } } @@ -982,7 +987,9 @@ int ObDDLRedoLogHandle::wait(const int64_t timeout) bool finish = false; const int64_t start_time = ObTimeUtility::current_time(); while (OB_SUCC(ret) && !finish) { - if (cb_->is_success()) { + if (OB_FAIL(THIS_WORKER.check_status())) { + LOG_WARN("check status failed", K(ret)); + } else if (cb_->is_success()) { finish = true; } else if (cb_->is_failed()) { ret = OB_NOT_MASTER; @@ -991,8 +998,11 @@ int ObDDLRedoLogHandle::wait(const int64_t timeout) const int64_t current_time = ObTimeUtility::current_time(); if (current_time - start_time > timeout) { ret = OB_TIMEOUT; - LOG_WARN("write ddl redo log timeout", K(ret)); + LOG_WARN("write ddl redo log timeout", K(ret), K(current_time), K(start_time)); } else { + if (REACH_TIME_INTERVAL(10L * 1000L * 1000L)) { //10s + LOG_INFO("wait ddl redo log callback", K(ret), K(finish), K(current_time), K(start_time)); + } ob_usleep(ObDDLRedoLogHandle::CHECK_DDL_REDO_LOG_FINISH_INTERVAL); } } @@ -1019,7 +1029,9 @@ int ObDDLCommitLogHandle::wait(const int64_t timeout) bool finish = false; const int64_t start_time = ObTimeUtility::current_time(); while (OB_SUCC(ret) && !finish) { - if (cb_->is_success()) { + if (OB_FAIL(THIS_WORKER.check_status())) { + LOG_WARN("check status failed", K(ret)); + } else if (cb_->is_success()) { finish = true; ret = cb_->get_ret_code(); if (OB_FAIL(ret)) { @@ -1032,8 +1044,11 @@ int ObDDLCommitLogHandle::wait(const int64_t timeout) const int64_t current_time = ObTimeUtility::current_time(); if (current_time - start_time > timeout) { ret = OB_TIMEOUT; - LOG_WARN("write ddl commit log timeout", K(ret)); + LOG_WARN("write ddl commit log timeout", K(ret), K(current_time), K(start_time)); } else { + if (REACH_TIME_INTERVAL(10L * 1000L * 1000L)) { //10s + LOG_INFO("wait ddl commit log callback", K(ret), K(finish), K(current_time), K(start_time)); + } ob_usleep(ObDDLRedoLogHandle::CHECK_DDL_REDO_LOG_FINISH_INTERVAL); } } diff --git a/src/storage/ddl/ob_ddl_redo_log_writer.h b/src/storage/ddl/ob_ddl_redo_log_writer.h index 4a31711e1f..9aa2e30fd5 100644 --- a/src/storage/ddl/ob_ddl_redo_log_writer.h +++ b/src/storage/ddl/ob_ddl_redo_log_writer.h @@ -184,7 +184,7 @@ private: struct ObDDLRedoLogHandle final { public: - static const int64_t DDL_REDO_LOG_TIMEOUT = 10 * 1000 * 1000; // 10 + static const int64_t DDL_REDO_LOG_TIMEOUT = 60 * 1000 * 1000; // 1min static const int64_t CHECK_DDL_REDO_LOG_FINISH_INTERVAL = 1000; // 1ms ObDDLRedoLogHandle(); ~ObDDLRedoLogHandle();