larger ddl_redo_log write timeout

This commit is contained in:
renju96
2023-08-10 11:42:28 +00:00
committed by ob-robot
parent c8b25e12c8
commit 12edc62dbc
2 changed files with 22 additions and 7 deletions

View File

@ -818,7 +818,9 @@ int ObDDLRedoLogWriter::write_ddl_start_log(ObTabletHandle &tablet_handle,
bool finish = false; bool finish = false;
const int64_t start_time = ObTimeUtility::current_time(); const int64_t start_time = ObTimeUtility::current_time();
while (OB_SUCC(ret) && !finish) { 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; finish = true;
} else if (tmp_cb->is_failed()) { } else if (tmp_cb->is_failed()) {
ret = OB_NOT_MASTER; 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(); const int64_t current_time = ObTimeUtility::current_time();
if (current_time - start_time > ObDDLRedoLogHandle::DDL_REDO_LOG_TIMEOUT) { if (current_time - start_time > ObDDLRedoLogHandle::DDL_REDO_LOG_TIMEOUT) {
ret = OB_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 { } 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); ob_usleep(ObDDLRedoLogHandle::CHECK_DDL_REDO_LOG_FINISH_INTERVAL);
} }
} }
@ -982,7 +987,9 @@ int ObDDLRedoLogHandle::wait(const int64_t timeout)
bool finish = false; bool finish = false;
const int64_t start_time = ObTimeUtility::current_time(); const int64_t start_time = ObTimeUtility::current_time();
while (OB_SUCC(ret) && !finish) { 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; finish = true;
} else if (cb_->is_failed()) { } else if (cb_->is_failed()) {
ret = OB_NOT_MASTER; ret = OB_NOT_MASTER;
@ -991,8 +998,11 @@ int ObDDLRedoLogHandle::wait(const int64_t timeout)
const int64_t current_time = ObTimeUtility::current_time(); const int64_t current_time = ObTimeUtility::current_time();
if (current_time - start_time > timeout) { if (current_time - start_time > timeout) {
ret = OB_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 { } 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); ob_usleep(ObDDLRedoLogHandle::CHECK_DDL_REDO_LOG_FINISH_INTERVAL);
} }
} }
@ -1019,7 +1029,9 @@ int ObDDLCommitLogHandle::wait(const int64_t timeout)
bool finish = false; bool finish = false;
const int64_t start_time = ObTimeUtility::current_time(); const int64_t start_time = ObTimeUtility::current_time();
while (OB_SUCC(ret) && !finish) { 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; finish = true;
ret = cb_->get_ret_code(); ret = cb_->get_ret_code();
if (OB_FAIL(ret)) { if (OB_FAIL(ret)) {
@ -1032,8 +1044,11 @@ int ObDDLCommitLogHandle::wait(const int64_t timeout)
const int64_t current_time = ObTimeUtility::current_time(); const int64_t current_time = ObTimeUtility::current_time();
if (current_time - start_time > timeout) { if (current_time - start_time > timeout) {
ret = OB_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 { } 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); ob_usleep(ObDDLRedoLogHandle::CHECK_DDL_REDO_LOG_FINISH_INTERVAL);
} }
} }

View File

@ -184,7 +184,7 @@ private:
struct ObDDLRedoLogHandle final struct ObDDLRedoLogHandle final
{ {
public: 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 static const int64_t CHECK_DDL_REDO_LOG_FINISH_INTERVAL = 1000; // 1ms
ObDDLRedoLogHandle(); ObDDLRedoLogHandle();
~ObDDLRedoLogHandle(); ~ObDDLRedoLogHandle();