Repository: kudu Updated Branches: refs/heads/master 805d1cf84 -> 164368b2f
KUDU-1634 (part 2). Removed redundant check for tmp log segments. Temporary consensus log semgents are being named this way: .tmp.newsegmentXXXXXX, meaning they are already being ignorred by HasPrefixString(fname, ".") check for hidden files and "." or "..". So, there is actually no reason to look for tmp files specifically. Change-Id: I9cf25fbe6ecfc28aed9443cdfb6fb56100394c73 Reviewed-on: http://gerrit.cloudera.org:8080/5122 Reviewed-by: Adar Dembo <[email protected]> Reviewed-by: Todd Lipcon <[email protected]> Tested-by: Adar Dembo <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/164368b2 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/164368b2 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/164368b2 Branch: refs/heads/master Commit: 164368b2f407e0a3e2e9fe51d8b21475892e0c1d Parents: 805d1cf Author: Maxim Smyatkin <[email protected]> Authored: Thu Nov 17 10:34:35 2016 +0300 Committer: Adar Dembo <[email protected]> Committed: Wed Nov 23 21:23:23 2016 +0000 ---------------------------------------------------------------------- src/kudu/consensus/log_util.cc | 7 ------- src/kudu/consensus/log_util.h | 3 --- 2 files changed, 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/164368b2/src/kudu/consensus/log_util.cc ---------------------------------------------------------------------- diff --git a/src/kudu/consensus/log_util.cc b/src/kudu/consensus/log_util.cc index 8ed9185..780b517 100644 --- a/src/kudu/consensus/log_util.cc +++ b/src/kudu/consensus/log_util.cc @@ -69,8 +69,6 @@ using std::unique_ptr; using strings::Substitute; using strings::SubstituteAndAppend; -const char kTmpSuffix[] = ".tmp"; - const char kLogSegmentHeaderMagicString[] = "kudulogf"; // A magic that is written as the very last thing when a segment is closed. @@ -807,11 +805,6 @@ bool IsLogFileName(const string& fname) { return false; } - if (HasSuffixString(fname, kTmpSuffix)) { - LOG(WARNING) << "Ignoring tmp file: " << fname; - return false; - } - vector<string> v = strings::Split(fname, "-"); if (v.size() != 2 || v[0] != FsManager::kWalFileNamePrefix) { VLOG(1) << "Not a log file: " << fname; http://git-wip-us.apache.org/repos/asf/kudu/blob/164368b2/src/kudu/consensus/log_util.h ---------------------------------------------------------------------- diff --git a/src/kudu/consensus/log_util.h b/src/kudu/consensus/log_util.h index f64aadd..8fd61d6 100644 --- a/src/kudu/consensus/log_util.h +++ b/src/kudu/consensus/log_util.h @@ -45,9 +45,6 @@ struct OpIdBiggerThanFunctor; namespace log { -// Suffix for temprorary files -extern const char kTmpSuffix[]; - // Each log entry is prefixed by its length (4 bytes), CRC (4 bytes), // and checksum of the other two fields (see EntryHeader struct below). extern const size_t kEntryHeaderSize;
