Skip to content

Commit

Permalink
larger ddl_redo_log write timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
renju96 authored and ob-robot committed Aug 10, 2023
1 parent c8b25e1 commit 12edc62
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
27 changes: 21 additions & 6 deletions src/storage/ddl/ob_ddl_redo_log_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand All @@ -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)) {
Expand All @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/storage/ddl/ob_ddl_redo_log_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class ObDDLCtrlSpeedHandle final
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();
Expand Down

0 comments on commit 12edc62

Please sign in to comment.