gavinchou commented on code in PR #42227:
URL: https://github.com/apache/doris/pull/42227#discussion_r1809142606


##########
be/src/cloud/cloud_base_compaction.cpp:
##########
@@ -49,7 +49,10 @@ CloudBaseCompaction::~CloudBaseCompaction() = default;
 
 Status CloudBaseCompaction::prepare_compact() {
     if (_tablet->tablet_state() != TABLET_RUNNING) {
-        return Status::InternalError("invalid tablet state. tablet_id={}", 
_tablet->tablet_id());
+        Status res = Status::InternalError("invalid tablet state. 
tablet_id={}", _tablet->tablet_id());

Review Comment:
   Use defer samentic to avoid duplicated code, e.g.
   ```
   Defer  defer_set_st([&failed, &st] {
       if (!failed) return;
       cloud_tablet()->set_last_full_compaction_failure_time(UnixMillis());
       cloud_tablet()->set_last_full_compaction_status(st.to_string());
   });
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to