[CP] [OBCDC] Fix the computational logic of the safety checkpoint

This commit is contained in:
obdev
2022-11-15 06:38:10 +00:00
committed by wangzelin.wzl
parent 2599b6fb70
commit d813d37a37
2 changed files with 15 additions and 11 deletions

View File

@ -733,19 +733,23 @@ void ObLogCommitter::heartbeat_routine()
}
}
int64_t output_checkpoint = OB_INVALID_TIMESTAMP;
// periodically send a heartbeat binlog record
// checkpoint timestamp is invalid for the first time, here ensure that the heartbeat is sent as soon as the checkpoint timestamp is valid
if (OB_FAIL(ret)) {
} else if (OB_FAIL(calculate_output_checkpoint_(output_checkpoint))) {
if (OB_SUCC(ret)) {
if (REACH_TIME_INTERVAL(g_output_heartbeat_interval)) {
int64_t output_checkpoint = OB_INVALID_TIMESTAMP;
if (OB_FAIL(calculate_output_checkpoint_(output_checkpoint))) {
LOG_ERROR("calculate_output_checkpoint_ failed", KR(ret), K(output_checkpoint));
} else if (OB_LIKELY(OB_INVALID_TIMESTAMP != output_checkpoint) && REACH_TIME_INTERVAL(g_output_heartbeat_interval)) {
} else if (OB_INVALID_TIMESTAMP != output_checkpoint) {
if (OB_FAIL(dispatch_heartbeat_binlog_record_(output_checkpoint))) {
if (OB_IN_STOP_STATE != ret) {
LOG_ERROR("dispatch_heartbeat_binlog_record_ fail", KR(ret), K(output_checkpoint));
}
}
}
}
}
if (REACH_TIME_INTERVAL(PRINT_GLOBAL_HEARTBEAT_CHECKPOINT_INTERVAL)) {
print_global_heartbeat_info_();