switchover to primary check ls is sync on RS side
This commit is contained in:
@ -1822,11 +1822,24 @@ int ObSwitchTenantExecutor::execute(ObExecContext &ctx, ObSwitchTenantStmt &stmt
|
||||
ObSwitchTenantArg &arg = stmt.get_arg();
|
||||
arg.set_stmt_str(first_stmt);
|
||||
|
||||
//left 200ms to return result
|
||||
const int64_t remain_timeout_interval_us = THIS_WORKER.get_timeout_remain();
|
||||
const int64_t execute_timeout_interval_us = remain_timeout_interval_us - 200 * 1000; // left 200ms to return result
|
||||
const int64_t original_timeout_abs_us = THIS_WORKER.get_timeout_ts();
|
||||
if (0 < execute_timeout_interval_us) {
|
||||
THIS_WORKER.set_timeout_ts(ObTimeUtility::current_time() + execute_timeout_interval_us);
|
||||
}
|
||||
|
||||
// TODO support specify ALL
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_FAIL(OB_PRIMARY_STANDBY_SERVICE.switch_tenant(arg))) {
|
||||
LOG_WARN("failed to switch_tenant", KR(ret), K(arg));
|
||||
}
|
||||
|
||||
//set timeout back
|
||||
if (0 < execute_timeout_interval_us) {
|
||||
THIS_WORKER.set_timeout_ts(original_timeout_abs_us);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user