gavinchou commented on code in PR #42227:
URL: https://github.com/apache/doris/pull/42227#discussion_r1809142031
##########
be/src/cloud/cloud_full_compaction.cpp:
##########
@@ -52,13 +52,26 @@ CloudFullCompaction::~CloudFullCompaction() = default;
Status CloudFullCompaction::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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]