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 ad59cea  KUDU-3280: fix flakiness in 
TabletServerTest.TestStarvePerfImprovementOpsInColdTablet
ad59cea is described below

commit ad59ceaeff158111f4b8b723ce12870527839343
Author: zhangyifan27 <chinazhangyi...@163.com>
AuthorDate: Thu May 6 14:49:16 2021 +0800

    KUDU-3280: fix flakiness in 
TabletServerTest.TestStarvePerfImprovementOpsInColdTablet
    
    The test failed because the original perf improvement score
    of flush/compaction ops in hot tablet may be always higher
    than that in cold tablet. This patch fixed it by increasing
    `FLAGS_flush_threshold_mb` and `FLAGS_flush_upper_bound_ms`
    and reducing the amount of data written in hot tablet, so
    the cold tablet would be compacted if
    'workload_score_for_perf_improvement_ops' was diabled.
    
    Change-Id: I9fca72965f25c14446741cc9602c4690404933f4
    Reviewed-on: http://gerrit.cloudera.org:8080/17409
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <aser...@cloudera.com>
---
 src/kudu/tserver/tablet_server-test.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/kudu/tserver/tablet_server-test.cc 
b/src/kudu/tserver/tablet_server-test.cc
index 86a8aa0..6538e35 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -187,6 +187,7 @@ DECLARE_double(tablet_inject_kudu_2233);
 DECLARE_double(workload_score_upper_bound);
 DECLARE_int32(flush_threshold_mb);
 DECLARE_int32(flush_threshold_secs);
+DECLARE_int32(flush_upper_bound_ms);
 DECLARE_int32(fs_data_dirs_available_space_cache_seconds);
 DECLARE_int32(fs_target_data_dirs_per_tablet);
 DECLARE_int32(maintenance_manager_inject_latency_ms);
@@ -4441,14 +4442,16 @@ TEST_F(TabletServerTest, 
TestStarvePerfImprovementOpsInColdTablet) {
   // so there are always something to do in the hot tablet.
   FLAGS_flush_threshold_secs = 1;
   FLAGS_maintenance_manager_inject_latency_ms = 1000;
+  // Make the original perf improvement score of a flush op smaller than that 
of a compaction op.
+  FLAGS_flush_threshold_mb = 10 * 1024;
+  FLAGS_flush_upper_bound_ms = 10 * 60 * 60 * 1000;
 
   // Make the default tablet 'hot'.
   std::atomic<bool> keep_inserting_and_scanning(true);
   thread insert_thread([&] {
     int cur_row = 0;
     while (keep_inserting_and_scanning) {
-      NO_FATALS(InsertTestRowsDirect(cur_row, 1000));
-      cur_row += 1000;
+      NO_FATALS(InsertTestRowsDirect(cur_row++, 1));
       ScanResponsePB resp;
       NO_FATALS(OpenScannerWithAllColumns(&resp));
       ASSERT_TRUE(!resp.scanner_id().empty());

Reply via email to