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 2020/06/11 06:07:08 UTC

[kudu] branch master updated: [consensus] small clean-up on Log

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 7142a4f  [consensus] small clean-up on Log
7142a4f is described below

commit 7142a4f1c3f6d281968b1f4506a1a3007f00cad3
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Wed Jun 10 12:12:26 2020 -0700

    [consensus] small clean-up on Log
    
    This patch doesn't contain any functional modifications.
    
    Change-Id: I574543a0f98871f6b66b8ddf578bd10bd3f7d98c
    Reviewed-on: http://gerrit.cloudera.org:8080/16061
    Tested-by: Kudu Jenkins
    Reviewed-by: Bankim Bhavsar <ba...@cloudera.com>
---
 src/kudu/consensus/log.cc | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/kudu/consensus/log.cc b/src/kudu/consensus/log.cc
index 3610ee6..1afda83 100644
--- a/src/kudu/consensus/log.cc
+++ b/src/kudu/consensus/log.cc
@@ -102,11 +102,6 @@ DEFINE_bool(log_inject_latency, false,
             "If true, injects artificial latency in log sync operations. "
             "Advanced option. Use at your own risk -- has a negative effect "
             "on performance for obvious reasons!");
-
-DEFINE_bool(skip_remove_old_recovery_dir, false,
-            "Skip removing WAL recovery dir after startup. (useful for debugging)");
-TAG_FLAG(skip_remove_old_recovery_dir, hidden);
-
 TAG_FLAG(log_inject_latency, unsafe);
 TAG_FLAG(log_inject_latency, runtime);
 
@@ -164,6 +159,10 @@ DEFINE_bool(fs_wal_use_file_cache, true,
 TAG_FLAG(fs_wal_use_file_cache, runtime);
 TAG_FLAG(fs_wal_use_file_cache, advanced);
 
+DEFINE_bool(skip_remove_old_recovery_dir, false,
+            "Skip removing WAL recovery dir after startup. (useful for debugging)");
+TAG_FLAG(skip_remove_old_recovery_dir, hidden);
+
 // Validate that log_min_segments_to_retain >= 1
 static bool ValidateLogsToRetain(const char* flagname, int value) {
   if (value >= 1) {
@@ -175,17 +174,16 @@ static bool ValidateLogsToRetain(const char* flagname, int value) {
 }
 DEFINE_validator(log_min_segments_to_retain, &ValidateLogsToRetain);
 
-namespace kudu {
-namespace log {
-
-using consensus::CommitMsg;
-using consensus::ReplicateRefPtr;
-using std::shared_ptr;
+using kudu::consensus::CommitMsg;
+using kudu::consensus::ReplicateRefPtr;
 using std::string;
 using std::vector;
 using std::unique_ptr;
 using strings::Substitute;
 
+namespace kudu {
+namespace log {
+
 string LogContext::LogPrefix() const {
   return Substitute("T $0 P $1: ", tablet_id, fs_manager->uuid());
 }
@@ -507,10 +505,9 @@ Status SegmentAllocator::Sync() {
     }
   }
 
-  if (opts_->force_fsync_all && !false) {
+  if (opts_->force_fsync_all) {
     LOG_SLOW_EXECUTION(WARNING, 50, Substitute("$0Fsync log took a long time", LogPrefix())) {
       RETURN_NOT_OK(active_segment_->Sync());
-
       if (hooks_) {
         RETURN_NOT_OK_PREPEND(hooks_->PostSyncIfFsyncEnabled(),
                               "PostSyncIfFsyncEnabled hook failed");