[OBCDC] Fix misjudge LS_OFFLINE LOG and OBCDC exit process
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
#include "ob_log_instance.h" // TCTX
|
||||
#include "ob_log_fetcher.h" // IObLogFetcher
|
||||
#include "logservice/restoreservice/ob_remote_log_source_allocator.h"
|
||||
#include "logservice/ob_garbage_collector.h" // ObGCLSLog
|
||||
|
||||
#define STAT(level, fmt, args...) OBLOG_FETCHER_LOG(level, "[STAT] [FETCH_CTX] " fmt, ##args)
|
||||
#define _STAT(level, fmt, args...) _OBLOG_FETCHER_LOG(level, "[STAT] [FETCH_CTX] " fmt, ##args)
|
||||
@ -583,9 +584,22 @@ int LSFetchCtx::handle_offline_ls_log_(const palf::LogEntry &log_entry,
|
||||
volatile bool &stop_flag)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
// const uint64_t log_id = log_entry.get_header().get_log_id();
|
||||
// const int64_t tstamp = log_entry.get_header().get_submit_timestamp();
|
||||
const char *buf = log_entry.get_data_buf();
|
||||
const int64_t buf_len = log_entry.get_data_len();
|
||||
const int64_t submit_ts = log_entry.get_scn().get_val_for_logservice();
|
||||
int64_t pos = 0;
|
||||
logservice::ObGCLSLog gc_log;
|
||||
|
||||
if (OB_ISNULL(buf) || OB_UNLIKELY(buf_len <= 0)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_ERROR("invalid GCLSLogEntry", KR(ret), K(log_entry), K(buf_len));
|
||||
} else if (OB_FAIL(gc_log.deserialize(buf, buf_len, pos))) {
|
||||
LOG_ERROR("deserialize GCLSLog failed", KR(ret), K(log_entry), K(buf_len), K(pos));
|
||||
} else {
|
||||
LOG_INFO("[HANDLE_OFFLINE_LOG] detect GCLSLog", K(gc_log), K(log_entry));
|
||||
logservice::ObGCLSLOGType log_type = static_cast<logservice::ObGCLSLOGType>(gc_log.get_log_type());
|
||||
|
||||
if (logservice::ObGCLSLOGType::OFFLINE_LS == log_type) {
|
||||
ISTAT("[HANDLE_OFFLINE_LOG] begin", K_(tls_id), "state", print_state(state_));
|
||||
|
||||
// For OFFLINE logs, only tasks in NORMAL state are processed
|
||||
@ -619,6 +633,8 @@ int LSFetchCtx::handle_offline_ls_log_(const palf::LogEntry &log_entry,
|
||||
}
|
||||
|
||||
ISTAT("[HANDLE_OFFLINE_LOG] end", KR(ret), K_(tls_id), "state", print_state(state_));
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user