Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/19246 )

Change subject: KUDU-3406 [compaction] Increase chances of compaction for large 
number deltas
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/19246/4/src/kudu/tablet/tablet_mm_ops.cc
File src/kudu/tablet/tablet_mm_ops.cc:

http://gerrit.cloudera.org:8080/#/c/19246/4/src/kudu/tablet/tablet_mm_ops.cc@151
PS4, Line 151: CountUndoDeltasForTests
> +1
I guess we should strive to prioritize operations that compact rowsets with too 
many UNDO delta memstores.  There is DeltaTracker::CountUndoDeltaStores() 
method to get the number of UNDO delta memstores.  It might be in the line of 
following:

diff --git a/src/kudu/tablet/tablet.cc b/src/kudu/tablet/tablet.cc
index 592c7c868..d14db3c8a 100644
--- a/src/kudu/tablet/tablet.cc
+++ b/src/kudu/tablet/tablet.cc
@@ -2187,7 +2187,7 @@ void Tablet::UpdateCompactionStats(MaintenanceOpStats* 
stats) {
   }

   double quality = 0;
-  unordered_set<const RowSet*> picked_set_ignored;
+  unordered_set<const RowSet*> picked;

   shared_ptr<RowSetTree> rowsets_copy;
   {
@@ -2197,10 +2197,19 @@ void Tablet::UpdateCompactionStats(MaintenanceOpStats* 
stats) {

   {
     std::lock_guard<std::mutex> compact_lock(compact_select_lock_);
-    WARN_NOT_OK(compaction_policy_->PickRowSets(*rowsets_copy, 
&picked_set_ignored, &quality, NULL),
+    WARN_NOT_OK(compaction_policy_->PickRowSets(*rowsets_copy, &picked, 
&quality, nullptr),
                 Substitute("Couldn't determine compaction quality for $0", 
tablet_id()));
   }

+  for (const auto* rs : picked) {
+    const auto* drs = down_cast<const DiskRowSet*>(rs);
+    const auto& dt = drs->delta_tracker();
+    const auto ds_num = dt.CountUndoDeltaStores();
+    LOG(INFO) << Substitute(
+        "STATS: rowset $0 has: $1 UNDO delta stores; $2 on disk; $3 memory",
+        drs->ToString(), ds_num, dt.UndoDeltaOnDiskSize(), 
dt.DeltaMemStoreSize());
+  }
+
   VLOG_WITH_PREFIX(1) << "Best compaction for " << tablet_id() << ": " << 
quality;

   stats->set_runnable(quality >= 0);



--
To view, visit http://gerrit.cloudera.org:8080/19246
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2199ae3b777e75b15b60d8ad818cc6adc4f5fa3b
Gerrit-Change-Number: 19246
Gerrit-PatchSet: 4
Gerrit-Owner: Ashwani Raina <[email protected]>
Gerrit-Reviewer: Abhishek Chennaka <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Ashwani Raina <[email protected]>
Gerrit-Reviewer: Khazar Mammadli <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Tue, 22 Nov 2022 17:41:12 +0000
Gerrit-HasComments: Yes

Reply via email to