This is an automated email from the ASF dual-hosted git repository. mgreber pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 8a0c4bd44365c5ce81554796ae9b1f2c3444c410 Author: Alexey Serbin <[email protected]> AuthorDate: Fri Feb 6 16:17:44 2026 -0800 [consensus] report tablet ID with CheckOpInSequence in AdvanceCommittedIndex To help in troubleshooting of WAL corruption issues, it makes sense adding the tablet's identifier into the log message emitted by PendingRounds::AdvanceCommittedIndex() when CheckOpInSequence() returns non-OK status. Given that corruption isn't expected, add EXPECT_FALSE() where appropriate. This changelist doesn't contain any functional modifications. Change-Id: I70df3ea624140d73c1ae4d3664d30b74dbfc91cb Reviewed-on: http://gerrit.cloudera.org:8080/23949 Tested-by: Kudu Jenkins Reviewed-by: Gabriella Lotz <[email protected]> Reviewed-by: Marton Greber <[email protected]> --- src/kudu/consensus/pending_rounds.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kudu/consensus/pending_rounds.cc b/src/kudu/consensus/pending_rounds.cc index 984495550..d5cad758b 100644 --- a/src/kudu/consensus/pending_rounds.cc +++ b/src/kudu/consensus/pending_rounds.cc @@ -186,7 +186,12 @@ Status PendingRounds::AdvanceCommittedIndex(int64_t committed_index) { const OpId& current_id = round->id(); if (PREDICT_TRUE(last_committed_op_id_ != MinimumOpId())) { - CHECK_OK(CheckOpInSequence(last_committed_op_id_, current_id)); + const auto s = CheckOpInSequence(last_committed_op_id_, current_id); + if (PREDICT_FALSE(!s.ok())) { + LOG_WITH_PREFIX(FATAL) + << Substitute("could not advance committed index to $0: $1", + committed_index, s.ToString()); + } } iter = pending_ops_.erase(iter); @@ -224,11 +229,11 @@ Status PendingRounds::SetInitialCommittedOpId(const OpId& committed_op) { } Status PendingRounds::CheckOpInSequence(const OpId& previous, const OpId& current) { - if (current.term() < previous.term()) { + if (PREDICT_FALSE(current.term() < previous.term())) { return Status::Corruption(Substitute("New operation's term is not >= than the previous " "op's term. Current: $0. Previous: $1", OpIdToString(current), OpIdToString(previous))); } - if (current.index() != previous.index() + 1) { + if (PREDICT_FALSE(current.index() != previous.index() + 1)) { return Status::Corruption(Substitute("New operation's index does not follow the previous" " op's index. Current: $0. Previous: $1", OpIdToString(current), OpIdToString(previous))); }
