You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Adar Dembo (Code Review)" <ge...@cloudera.org> on 2016/11/29 01:43:11 UTC

[kudu-CR] KUDU-1764: truncate preallocated space off of full lbm containers

Hello Todd Lipcon,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/5254

to review the following change.

Change subject: KUDU-1764: truncate preallocated space off of full lbm containers
......................................................................

KUDU-1764: truncate preallocated space off of full lbm containers

The LBM maintains a preallocation window at the end of each container, but
it erroneously leaves the window intact even as a container becomes full.

This patch addresses that in two ways:
1. The window is truncated when a container becomes full, and
2. It is truncated at startup after a full container is loaded.

The first trims the window in real time, while the second handles both
existing deployments and the edge case where a tserver has crashed mid-trim.

The implementation uses total_bytes_written_ as the truncation offset, which
means it still leaves last_block_size % filesystem_block_size bytes behind.
This is equivalent to the internal fragmentation caused by aligning block
offsets to the nearest filesystem block size, so I don't think it matters.

I snuck in a change to remove the "filesystem does not support
preallocation" behavior from block-manager-test; it's not possible to create
an LBM on a filesystem sans hole punching; such a filesystem should support
preallocation by definition.

Change-Id: Ib9173f955e53d096bfd9d3ddacf4294846cff11a
---
M src/kudu/fs/block_manager-test.cc
M src/kudu/fs/log_block_manager.cc
2 files changed, 92 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/54/5254/1
-- 
To view, visit http://gerrit.cloudera.org:8080/5254
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9173f955e53d096bfd9d3ddacf4294846cff11a
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-1764: truncate preallocated space off of full lbm containers

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged.

Change subject: KUDU-1764: truncate preallocated space off of full lbm containers
......................................................................


KUDU-1764: truncate preallocated space off of full lbm containers

The LBM maintains a preallocation window at the end of each container, but
it erroneously leaves the window intact even as a container becomes full.

This patch addresses that in two ways:
1. The window is truncated when a container becomes full, and
2. It is truncated at startup after a full container is loaded.

The first trims the window in real time, while the second handles both
existing deployments and the edge case where a tserver has crashed mid-trim.

The implementation uses total_bytes_written_ as the truncation offset, which
means it still leaves last_block_size % filesystem_block_size bytes behind.
This is equivalent to the internal fragmentation caused by aligning block
offsets to the nearest filesystem block size, so I don't think it matters.

I snuck in a change to remove the "filesystem does not support
preallocation" behavior from block-manager-test; it's not possible to create
an LBM on a filesystem sans hole punching; such a filesystem should support
preallocation by definition.

Change-Id: Ib9173f955e53d096bfd9d3ddacf4294846cff11a
Reviewed-on: http://gerrit.cloudera.org:8080/5254
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Todd Lipcon <to...@apache.org>
---
M src/kudu/fs/block_manager-test.cc
M src/kudu/fs/log_block_manager.cc
2 files changed, 92 insertions(+), 12 deletions(-)

Approvals:
  Todd Lipcon: Looks good to me, approved; Verified
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/5254
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9173f955e53d096bfd9d3ddacf4294846cff11a
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-1764: truncate preallocated space off of full lbm containers

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.

Change subject: KUDU-1764: truncate preallocated space off of full lbm containers
......................................................................


Patch Set 1: Code-Review+2 Verified+1

Looks good. Also tested this on a 9-node cluster which has been online for a while and verified that it cleaned about 20GB of disk space per drive (~100G per node)

-- 
To view, visit http://gerrit.cloudera.org:8080/5254
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib9173f955e53d096bfd9d3ddacf4294846cff11a
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No