From ba2d7ae29bf79fbccc7fad6ba8bd557d2877bb6d Mon Sep 17 00:00:00 2001 From: dt0 Date: Thu, 16 Sep 2021 19:57:55 +0800 Subject: [PATCH] add log entry check_integrity compat --- src/archive/ob_archive_clog_split_engine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/archive/ob_archive_clog_split_engine.cpp b/src/archive/ob_archive_clog_split_engine.cpp index 817e5fefae..157c47bc9b 100644 --- a/src/archive/ob_archive_clog_split_engine.cpp +++ b/src/archive/ob_archive_clog_split_engine.cpp @@ -999,6 +999,11 @@ int ObArCLogSplitEngine::fetch_log_(const ObPGKey& pg_key, ObArchiveLogCursor& l int64_t pos = 0; if (OB_FAIL(log_entry.deserialize(res.buf_, res.data_len_, pos))) { ARCHIVE_LOG(WARN, "failed to deserialize log_entry", K(ret), K(pg_key), K(log_cursor), K(res)); + } else if (OB_UNLIKELY(!log_entry.check_integrity(true /*ignore_batch_commited*/))) { + // NB: batch_commited is for one phase commit, which is forbidden, + // but for cluster upgraded from lower version, it may be still open. + ret = OB_INVALID_DATA; + ARCHIVE_LOG(ERROR, "invalid log entry", KR(ret), K(pg_key), K(log_entry)); } } } -- GitLab