Repository: kudu
Updated Branches:
  refs/heads/master d87e3ff60 -> b1ef84e7b


Improve the debuggability of LogBlockContainer::CheckBlockRecord()

We're getting an error come up in the flaky tests that is hard to debug
because we don't print the data file size, which is the condition tripping
the check. This also includes the filename of the data file where the
offending record was found in the printout.

Change-Id: I3e74537ea258e8c6a0ffa00b9f5d529a04ecd583
Reviewed-on: http://gerrit.cloudera.org:8080/4451
Reviewed-by: Todd Lipcon <t...@apache.org>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/9aab93f0
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/9aab93f0
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/9aab93f0

Branch: refs/heads/master
Commit: 9aab93f05d7569130c57c11d9a934bd38a0f066f
Parents: d87e3ff
Author: David Alves <dral...@apache.org>
Authored: Mon Sep 19 15:58:22 2016 -0700
Committer: David Ribeiro Alves <dral...@apache.org>
Committed: Mon Sep 19 23:35:41 2016 +0000

----------------------------------------------------------------------
 src/kudu/fs/log_block_manager.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/9aab93f0/src/kudu/fs/log_block_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/log_block_manager.cc b/src/kudu/fs/log_block_manager.cc
index 02a1176..6866422 100644
--- a/src/kudu/fs/log_block_manager.cc
+++ b/src/kudu/fs/log_block_manager.cc
@@ -532,7 +532,9 @@ void LogBlockContainer::CheckBlockRecord(const 
BlockRecordPB& record,
         record.offset() < 0  ||
         record.length() < 0  ||
         record.offset() + record.length() > data_file_size)) {
-    LOG(FATAL) << "Found malformed block record: " << record.DebugString();
+    LOG(FATAL) << "Found malformed block record in data file: " << 
data_file_->filename()
+               << "\nRecord: " << record.DebugString()
+               << "\nData file size: " << data_file_size;
   }
 }
 

Reply via email to