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 2017/03/13 06:56:12 UTC

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

Hello Dinesh Bhat, Mike Percy, Todd Lipcon,

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

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

to review the following change.

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................

KUDU-1769: fs check action with rudimentary data block GC

This commit introduces a new "fs check" action to the CLI tool. For the time
being its capabilities are slim:
- Detecting missing blocks.
- Detecting orphaned blocks, optionally "repairing" (i.e. deleting) them.

I'm sure it'll be augmented to perform more consistency checks and repairs
in the future.

Why build this in the CLI tool and not in the block manager? A few reasons:
1. This "poor man" approach to GCing orphaned data blocks is extremely
   heavy-weight. Doing it at server startup is probably a bad idea.
2. Performance aside, finding a good time at server startup to compare the
   block lists will require additional refactoring and reordering.
3. If we change our minds, we can always move it later.

I do expect that the block manager will take on some check or repair duties,
but they'll be relegated to startup time, and will be much smaller in scope
(e.g. the LBM could repunch holes that previously failed to punch).

Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
---
M src/kudu/tablet/tablet_metadata.cc
M src/kudu/tablet/tablet_metadata.h
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_fs.cc
M src/kudu/tserver/tablet_copy_source_session.cc
5 files changed, 214 insertions(+), 11 deletions(-)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 3:

> It doesn't; see the NO_FATALS() call on RunFsCheck() just before.

Oh, great. I thought read-only mode still took the lock but just enforced read-only behavior.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 2:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/6361/2//COMMIT_MSG
Commit Message:

Line 24: I do expect that the block manager will take on some check or repair duties,
> Thinking aloud, would it make sense to run the scan of orphan blocks every 
Blocks can only be orphaned in the event of a crash, so there's no reason to scan for orphaned blocks outside of startup (and/or this tool).


http://gerrit.cloudera.org:8080/#/c/6361/2/src/kudu/tools/tool_action_fs.cc
File src/kudu/tools/tool_action_fs.cc:

PS2, Line 50: repair
> I wonder if  term 'repair' could give any wrong impression about the underl
I expect --repair to sprout additional functionality over time, which is why I chose a more generic verb.


PS2, Line 72: /*context*/
> Is this a way to silence unused warnings ?
I don't think we necessarily want to silence them; I'm happy to make whatever changes are needed to comply with clang-tidy.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 2: Verified+1

Failure is unrelated.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/6361/1/src/kudu/tools/tool_action_fs.cc
File src/kudu/tools/tool_action_fs.cc:

Line 72: Status Check(const RunnerContext& context) {
> warning: parameter 'context' is unused [misc-unused-parameters]
Done


PS1, Line 75: FsManagerOpts()
> opts
Good catch. As penance, I've added a test that fails with because of this buglet, but passes with the fix.


Line 143: Status Format(const RunnerContext& context) {
> warning: parameter 'context' is unused [misc-unused-parameters]
Done


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 2:

One thing: I'm pretty sure even in non-repair mode that command will fail. Right?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


KUDU-1769: fs check action with rudimentary data block GC

This commit introduces a new "fs check" action to the CLI tool. For the time
being its capabilities are slim:
- Detecting missing blocks.
- Detecting orphaned blocks, optionally "repairing" (i.e. deleting) them.

I'm sure it'll be augmented to perform more consistency checks and repairs
in the future.

Why build this in the CLI tool and not in the block manager? A few reasons:
1. This "poor man" approach to GCing orphaned data blocks is extremely
   heavy-weight. Doing it at server startup is probably a bad idea.
2. Performance aside, finding a good time at server startup to compare the
   block lists will require additional refactoring and reordering.
3. If we change our minds, we can always move it later.

I do expect that the block manager will take on some check or repair duties,
but they'll be relegated to startup time, and will be much smaller in scope
(e.g. the LBM could repunch holes that previously failed to punch).

Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Reviewed-on: http://gerrit.cloudera.org:8080/6361
Tested-by: Adar Dembo <ad...@cloudera.com>
Reviewed-by: Mike Percy <mp...@apache.org>
Reviewed-by: Dinesh Bhat <di...@cloudera.com>
---
M src/kudu/tablet/tablet_metadata.cc
M src/kudu/tablet/tablet_metadata.h
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_fs.cc
M src/kudu/tserver/tablet_copy_source_session.cc
5 files changed, 233 insertions(+), 14 deletions(-)

Approvals:
  Dinesh Bhat: Looks good to me, but someone else must approve
  Mike Percy: Looks good to me, approved
  Adar Dembo: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 2:

> One thing: I'm pretty sure even in non-repair mode that command
 > will fail. Right?

It doesn't; see the NO_FATALS() call on RunFsCheck() just before. The idea is that without --repair, the FsManager is opened in read only mode, and so it can be done concurrently with a running server.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

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

to look at the new patch set (#2).

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................

KUDU-1769: fs check action with rudimentary data block GC

This commit introduces a new "fs check" action to the CLI tool. For the time
being its capabilities are slim:
- Detecting missing blocks.
- Detecting orphaned blocks, optionally "repairing" (i.e. deleting) them.

I'm sure it'll be augmented to perform more consistency checks and repairs
in the future.

Why build this in the CLI tool and not in the block manager? A few reasons:
1. This "poor man" approach to GCing orphaned data blocks is extremely
   heavy-weight. Doing it at server startup is probably a bad idea.
2. Performance aside, finding a good time at server startup to compare the
   block lists will require additional refactoring and reordering.
3. If we change our minds, we can always move it later.

I do expect that the block manager will take on some check or repair duties,
but they'll be relegated to startup time, and will be much smaller in scope
(e.g. the LBM could repunch holes that previously failed to punch).

Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
---
M src/kudu/tablet/tablet_metadata.cc
M src/kudu/tablet/tablet_metadata.h
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_fs.cc
M src/kudu/tserver/tablet_copy_source_session.cc
5 files changed, 233 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/6361/2
-- 
To view, visit http://gerrit.cloudera.org:8080/6361
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 2: Code-Review+1

(3 comments)

Thanks for adding this Adar, LGTM, couple of minor comments below.

http://gerrit.cloudera.org:8080/#/c/6361/2//COMMIT_MSG
Commit Message:

Line 24: I do expect that the block manager will take on some check or repair duties,
Thinking aloud, would it make sense to run the scan of orphan blocks every now and then as a mantainance manager background task and once the number of orphan blocks crosses certain threshold, perhaps trigger the repair ?


http://gerrit.cloudera.org:8080/#/c/6361/2/src/kudu/tools/tool_action_fs.cc
File src/kudu/tools/tool_action_fs.cc:

PS2, Line 50: repair
I wonder if  term 'repair' could give any wrong impression about the underlying operation being performed. We are cleaning up the orphan blocks and fixing inconsistency for sure, but functionality is not similar to fsck --repair kinda I guess, and I don't have any better alternative word suggestion either :(. may be --free_orphan_blocks ?


PS2, Line 72: /*context*/
Is this a way to silence unused warnings ?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] KUDU-1769: fs check action with rudimentary data block GC

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

Change subject: KUDU-1769: fs check action with rudimentary data block GC
......................................................................


Patch Set 1:

(1 comment)

Everything else looks good modulo the clang-tidy complaints.

http://gerrit.cloudera.org:8080/#/c/6361/1/src/kudu/tools/tool_action_fs.cc
File src/kudu/tools/tool_action_fs.cc:

PS1, Line 75: FsManagerOpts()
opts


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82da8e234c338cd5a7540a22cebfa0a4958388ec
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes