You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2017/06/28 18:44:08 UTC

[3/5] kudu git commit: log block manager: do not fail block creation if truncate fails

log block manager: do not fail block creation if truncate fails

RETURN_NOT_OK here means WritableBlock::Close will fail unnecessarily. I
don't _think_ that could lead to on-disk corruption (the container has to be
full, so no blocks will be added to it after this one), but it'll cause some
inconsistency in metrics.

Change-Id: I96ce55eb1cd3a13f7cbfaf1bde7755c4d91a7dbd
Reviewed-on: http://gerrit.cloudera.org:8080/7312
Reviewed-by: Todd Lipcon <to...@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/4f9b0e32
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/4f9b0e32
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/4f9b0e32

Branch: refs/heads/master
Commit: 4f9b0e32fccf88af6b454a705fdba698a8afc9ba
Parents: e675873
Author: Adar Dembo <ad...@cloudera.com>
Authored: Tue Jun 27 17:59:26 2017 -0700
Committer: Todd Lipcon <to...@apache.org>
Committed: Wed Jun 28 18:12:53 2017 +0000

----------------------------------------------------------------------
 src/kudu/fs/log_block_manager.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/4f9b0e32/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 bc2ae7c..5942e9e 100644
--- a/src/kudu/fs/log_block_manager.cc
+++ b/src/kudu/fs/log_block_manager.cc
@@ -781,8 +781,9 @@ Status LogBlockContainer::FinishBlock(const Status& s, WritableBlock* block) {
   //
   // Note that this take places _after_ the container has been synced to disk.
   // That's OK; truncation isn't needed for correctness, and in the event of a
-  // crash, it will be retried at startup.
-  RETURN_NOT_OK(TruncateDataToNextBlockOffset());
+  // crash or error, it will be retried at startup.
+  WARN_NOT_OK(TruncateDataToNextBlockOffset(),
+              "could not truncate excess preallocated space");
 
   if (full() && block_manager()->metrics()) {
     block_manager()->metrics()->full_containers->Increment();