You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2025/06/02 18:04:15 UTC
(kudu) branch master updated: [tablet] simplify ApplyMutationsAndMergeDuplicateHistory
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new bd5e785e4 [tablet] simplify ApplyMutationsAndMergeDuplicateHistory
bd5e785e4 is described below
commit bd5e785e40b90023652990b341e730311efd116b
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Thu May 29 17:37:53 2025 -0700
[tablet] simplify ApplyMutationsAndMergeDuplicateHistory
One less parameter for ApplyMutationsAndMergeDuplicateHistory().
This changelist doesn't have any functional modifications.
Change-Id: Ib39474c5bc982977b6e74b4cff875cf941195005
Reviewed-on: http://gerrit.cloudera.org:8080/22959
Tested-by: Alexey Serbin <al...@apache.org>
Reviewed-by: Ashwani Raina <ar...@cloudera.com>
Reviewed-by: Marton Greber <gr...@gmail.com>
---
src/kudu/tablet/compaction.cc | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/kudu/tablet/compaction.cc b/src/kudu/tablet/compaction.cc
index ca8548b5e..d53ee460b 100644
--- a/src/kudu/tablet/compaction.cc
+++ b/src/kudu/tablet/compaction.cc
@@ -1536,7 +1536,7 @@ static void UndoListSanityCheck(Mutation* new_undos_head) {
}
#endif // NDEBUG
-// For each input row, go through all the REDO mutations and apply those to base row.
+// For the input row, go through all the REDO mutations and apply those to base row.
// Generate corresponding UNDO deltas for applied mutations.
// For a row with 'ghost' entries, merge their histories of mutations.
// Remove ancient UNDO mutations and check if row is required to be garbage collected.
@@ -1544,8 +1544,7 @@ static void UndoListSanityCheck(Mutation* new_undos_head) {
// Do sanity check for final UNDO list.
static Status ApplyMutationsAndMergeDuplicateHistory(const MvccSnapshot& snap,
const CompactionInputRow& input_row,
- size_t cur_row_idx,
- RowBlock* block,
+ RowBlockRow* dst_row,
Arena* arena,
const string& tablet_id,
const scoped_refptr<FsErrorManager>& err_mgr,
@@ -1561,8 +1560,7 @@ static Status ApplyMutationsAndMergeDuplicateHistory(const MvccSnapshot& snap,
DVLOG(4) << "Input Row: " << CompactionInputRowToString(input_row);
- RowBlockRow dst_row = block->row(cur_row_idx);
- RETURN_NOT_OK(CopyRow(input_row.row, &dst_row, static_cast<Arena*>(nullptr)));
+ RETURN_NOT_OK(CopyRow(input_row.row, dst_row, static_cast<Arena*>(nullptr)));
// Collect the new UNDO/REDO mutations.
Mutation* new_undos_head = nullptr;
@@ -1574,7 +1572,7 @@ static Status ApplyMutationsAndMergeDuplicateHistory(const MvccSnapshot& snap,
input_row,
arena,
history_gc_opts,
- &dst_row,
+ dst_row,
&new_undos_head,
&new_redos_head));
@@ -1591,15 +1589,15 @@ static Status ApplyMutationsAndMergeDuplicateHistory(const MvccSnapshot& snap,
new_redos_head,
&new_undos_head);
- DVLOG(4) << "Output Row: " << RowToString(dst_row, new_redos_head, new_undos_head) <<
- "; Was garbage collected? " << *is_garbage_collected;
+ DVLOG(4) << "Output Row: " << RowToString(*dst_row, new_redos_head, new_undos_head)
+ << "; Was garbage collected? " << *is_garbage_collected;
// Skip further processing if this row was garbage collected
if (!*is_garbage_collected) {
RETURN_NOT_OK(AppendDeltasToDRS(out,
new_undos_head,
new_redos_head,
- &dst_row));
+ dst_row));
// If the REDO is empty, it should not be a DELETE.
if (new_redos_head == nullptr) {
@@ -1645,10 +1643,10 @@ Status FlushCompactionInput(const string& tablet_id,
bool is_garbage_collected = false;
size_t arena_mem_before_mutations = input->PreparedBlockArena()->memory_footprint();
+ RowBlockRow dst_row = block.row(cur_row_idx);
RETURN_NOT_OK(ApplyMutationsAndMergeDuplicateHistory(snap,
row,
- cur_row_idx,
- &block,
+ &dst_row,
input->PreparedBlockArena(),
tablet_id,
error_manager,