Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24125 )

Change subject: KUDU-829 Add online gc op to clean orphaned blocks
......................................................................


Patch Set 2:

(15 comments)

A quick fast pass.

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

PS2:
I'd expect this patch to be posted on top of 
https://gerrit.cloudera.org/#/c/24092/, but it doesn't seem to be the case.  
Otherwise, there will be conflicts with https://gerrit.cloudera.org/#/c/24092/ 
upon an attempt to push this patch into the repo after review.


http://gerrit.cloudera.org:8080/#/c/24125/2//COMMIT_MSG@9
PS2, Line 9: manintenance
maintenance


http://gerrit.cloudera.org:8080/#/c/24125/2//COMMIT_MSG@34
PS2, Line 34: persisten
persistent


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet.cc
File src/kudu/tablet/tablet.cc:

http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet.cc@393
PS2, Line 393:   if (metrics_) {
If this condition necessary?


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_metadata.cc
File src/kudu/tablet/tablet_metadata.cc:

http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_metadata.cc@306
PS2, Line 306:       LOG_WITH_PREFIX(WARNING) << Substitute(
             :           "$0 orphaned block(s) could not be deleted from disk 
during tablet deletion "
             :           "and will occupy untracked disk space. "
             :           "Run 'kudu fs check --repair' to reclaim this disk 
space.",
             :           orphaned_blocks_.size());
Move logging outside of the critical section to avoid needlessly holding locks 
during IO.


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_metadata.cc@657
PS2, Line 657: if (to_retry.empty()) return;
style nit for here and elsewhere: use scope braces even for a one-liner 'if' as 
in the rest of this code below


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_metadata.cc@722
PS2, Line 722: they are retried on the next metadata flush
This complicates reading of the orphaned_block_cleanup_failures metric -- it 
becomes senseless.  Perhaps, it's necessary to introduce an extra gauge to see 
the number of blocks failed deletion last time.


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_metrics.h
File src/kudu/tablet/tablet_metrics.h:

http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_metrics.h@87
PS2, Line 87: Blocks cleaned and time spent
I'm not sure I can fathom a dual metric like described.


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.h
File src/kudu/tablet/tablet_mm_ops.h:

http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.h@169
PS2, Line 169: are created
appear


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.h@169
PS2, Line 169: compactioni
compaction


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.h@202
PS2, Line 202:  = 0
style nit: move initialization into one place -- if initializing some of the 
variables in the constructor initializers' list (e.g., the 'running_' field), 
move this there


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.cc
File src/kudu/tablet/tablet_mm_ops.cc:

http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.cc@392
PS2, Line 392: size_t num_pending = tablet_->metadata()->num_orphaned_blocks();
             :   if (num_pending == 0) {
nit: get rid of the temporary 'num_pending' variable


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.cc@405
PS2, Line 405: const int
Make this constexpr


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.cc@424
PS2, Line 424:   LOG(INFO) << LogPrefix() << "Retrying deletion of pending 
orphaned blocks";
What's the purpose of having this log line?  If this is for debugging, consider 
switching to VLOG(1) or similar.


http://gerrit.cloudera.org:8080/#/c/24125/2/src/kudu/tablet/tablet_mm_ops.cc@448
PS2, Line 448: std::string OrphanedBlockGCOp::LogPrefix() const {
             :   return tablet_->LogPrefix();
             : }
Why to have this if TabletOpBase::LogPrefix() does exactly same already?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I732133b460df2fe4c91d05f420dda6f0274d440e
Gerrit-Change-Number: 24125
Gerrit-PatchSet: 2
Gerrit-Owner: Ashwani Raina <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Comment-Date: Tue, 24 Mar 2026 23:28:08 +0000
Gerrit-HasComments: Yes

Reply via email to