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] fs: add BlockManager::GetAllBlockIds()

Hello Dinesh Bhat, Mike Percy, Todd Lipcon,

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

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

to review the following change.

Change subject: fs: add BlockManager::GetAllBlockIds()
......................................................................

fs: add BlockManager::GetAllBlockIds()

This method will be used in a poor man's data block GC. It's simple enough
to implement in the LBM, where all blocks are known, but more complicated in
the FBM.

Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
---
M src/kudu/fs/block_id.h
M src/kudu/fs/block_manager-stress-test.cc
M src/kudu/fs/block_manager-test.cc
M src/kudu/fs/block_manager.h
M src/kudu/fs/file_block_manager.cc
M src/kudu/fs/file_block_manager.h
M src/kudu/fs/log_block_manager.cc
M src/kudu/fs/log_block_manager.h
M src/kudu/tablet/compaction-test.cc
M src/kudu/tablet/rowset_metadata.cc
M src/kudu/tablet/tablet_metadata.h
M src/kudu/tserver/tablet_copy_source_session.h
M src/kudu/util/env.h
13 files changed, 161 insertions(+), 22 deletions(-)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
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] fs: add BlockManager::GetAllBlockIds()

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

Change subject: fs: add BlockManager::GetAllBlockIds()
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/block_manager-test.cc
File src/kudu/fs/block_manager-test.cc:

PS1, Line 1279: The file block manager should skip these.
> can you add: "... and thus they shouldn't appear in 'retrieved_ids' below."
Done


http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/block_manager.h
File src/kudu/fs/block_manager.h:

Line 247:   virtual Status GetAllBlockIds(std::vector<BlockId>* block_ids) = 0;
> can you add some note about the behavior this has with "in-flight" blocks? 
I'll add that although the function is thread-safe, none of the blocks are guaranteed to exist after the call; they may have been aborted, deleted, etc.


http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/file_block_manager.cc
File src/kudu/fs/file_block_manager.cc:

PS1, Line 727: vector<vector<BlockId>> block_id_vecs(dds.size());
             :   vector<Status> statuses(dds.size());
             :   for (int i = 0; i < dds.size(); i++) {
             :     dds[i]->ExecClosure(Bind(&GetAllBlockIdsForDataDir,
             :                              env_,
             :                              dds[i].get(),
             :                              &block_id_vecs[i],
             :                              &statuses[i]));
             :   }
> could this completely hog all the threads, if there are a lot of data dirs?
Each data dir has its own single-thread threadpool that only runs that dir's closures. So yes, we'll be "hogging" all the threads, but that's by design.


PS1, Line 747: block_ids->insert(block_ids->begin(),
             :                       ids.begin(), ids.end());
> nit no need to wrap
Done


http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/tablet/compaction-test.cc
File src/kudu/tablet/compaction-test.cc:

PS1, Line 1088:   std::sort(before_block_ids.begin(), before_block_ids.end(),
              :             BlockIdCompare());
              :   std::sort(after_block_ids.begin(), after_block_ids.end(),
              :             BlockIdCompare());
> nit no need to wrap
Done


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
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: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] fs: add BlockManager::GetAllBlockIds()

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

Change subject: fs: add BlockManager::GetAllBlockIds()
......................................................................


Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
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: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] fs: add BlockManager::GetAllBlockIds()

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

Change subject: fs: add BlockManager::GetAllBlockIds()
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/block_manager.h
File src/kudu/fs/block_manager.h:

Line 247:   virtual Status GetAllBlockIds(std::vector<BlockId>* block_ids) = 0;
can you add some note about the behavior this has with "in-flight" blocks? or an admonishment not to use it on a block manager under concurrent use?


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

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

[kudu-CR] fs: add BlockManager::GetAllBlockIds()

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

Change subject: fs: add BlockManager::GetAllBlockIds()
......................................................................


Patch Set 2: Verified+1

One test failed because the webserver failed to bind.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
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: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] fs: add BlockManager::GetAllBlockIds()

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/6360

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

Change subject: fs: add BlockManager::GetAllBlockIds()
......................................................................

fs: add BlockManager::GetAllBlockIds()

This method will be used in a poor man's data block GC. It's simple enough
to implement in the LBM, where all blocks are known, but more complicated in
the FBM.

Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
---
M src/kudu/fs/block_id.h
M src/kudu/fs/block_manager-stress-test.cc
M src/kudu/fs/block_manager-test.cc
M src/kudu/fs/block_manager.h
M src/kudu/fs/file_block_manager.cc
M src/kudu/fs/file_block_manager.h
M src/kudu/fs/log_block_manager.cc
M src/kudu/fs/log_block_manager.h
M src/kudu/tablet/compaction-test.cc
M src/kudu/tablet/rowset_metadata.cc
M src/kudu/tablet/tablet_metadata.h
M src/kudu/tserver/tablet_copy_source_session.h
M src/kudu/util/env.h
13 files changed, 161 insertions(+), 22 deletions(-)


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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
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: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] fs: add BlockManager::GetAllBlockIds()

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

Change subject: fs: add BlockManager::GetAllBlockIds()
......................................................................


Patch Set 1:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/block_manager-test.cc
File src/kudu/fs/block_manager-test.cc:

PS1, Line 1279: The file block manager should skip these.
can you add: "... and thus they shouldn't appear in 'retrieved_ids' below."


http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/file_block_manager.cc
File src/kudu/fs/file_block_manager.cc:

PS1, Line 727: vector<vector<BlockId>> block_id_vecs(dds.size());
             :   vector<Status> statuses(dds.size());
             :   for (int i = 0; i < dds.size(); i++) {
             :     dds[i]->ExecClosure(Bind(&GetAllBlockIdsForDataDir,
             :                              env_,
             :                              dds[i].get(),
             :                              &block_id_vecs[i],
             :                              &statuses[i]));
             :   }
could this completely hog all the threads, if there are a lot of data dirs? should we stagger this, or even run it in the caller thread


PS1, Line 747: block_ids->insert(block_ids->begin(),
             :                       ids.begin(), ids.end());
nit no need to wrap


http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/tablet/compaction-test.cc
File src/kudu/tablet/compaction-test.cc:

PS1, Line 1088:   std::sort(before_block_ids.begin(), before_block_ids.end(),
              :             BlockIdCompare());
              :   std::sort(after_block_ids.begin(), after_block_ids.end(),
              :             BlockIdCompare());
nit no need to wrap


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

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

[kudu-CR] fs: add BlockManager::GetAllBlockIds()

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

Change subject: fs: add BlockManager::GetAllBlockIds()
......................................................................


fs: add BlockManager::GetAllBlockIds()

This method will be used in a poor man's data block GC. It's simple enough
to implement in the LBM, where all blocks are known, but more complicated in
the FBM.

Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
Reviewed-on: http://gerrit.cloudera.org:8080/6360
Tested-by: Adar Dembo <ad...@cloudera.com>
Reviewed-by: David Ribeiro Alves <dr...@apache.org>
---
M src/kudu/fs/block_id.h
M src/kudu/fs/block_manager-stress-test.cc
M src/kudu/fs/block_manager-test.cc
M src/kudu/fs/block_manager.h
M src/kudu/fs/file_block_manager.cc
M src/kudu/fs/file_block_manager.h
M src/kudu/fs/log_block_manager.cc
M src/kudu/fs/log_block_manager.h
M src/kudu/tablet/compaction-test.cc
M src/kudu/tablet/rowset_metadata.cc
M src/kudu/tablet/tablet_metadata.h
M src/kudu/tserver/tablet_copy_source_session.h
M src/kudu/util/env.h
13 files changed, 161 insertions(+), 22 deletions(-)

Approvals:
  David Ribeiro Alves: Looks good to me, approved
  Adar Dembo: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262
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: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Dinesh Bhat <di...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>