gavinchou commented on code in PR #54094:
URL: https://github.com/apache/doris/pull/54094#discussion_r2272323679
##########
cloud/src/meta-service/meta_service_job.cpp:
##########
@@ -1088,14 +1188,38 @@ void process_compaction_job(MetaServiceCode& code,
std::string& msg, std::string
?
recorded_job.schema_change().alter_version()
: -1);
need_commit = true;
+
+ if (!compaction_log.recycle_rowsets().empty() && is_versioned_write) {
+ std::string operation_log_key = versioned::log_key({instance_id});
+ std::string operation_log_value;
+ OperationLogPB operation_log;
+ operation_log.mutable_compaction()->Swap(&compaction_log);
+ if (!operation_log.SerializeToString(&operation_log_value)) {
+ code = MetaServiceCode::PROTOBUF_SERIALIZE_ERR;
+ msg = fmt::format("failed to serialize OperationLogPB: {}",
hex(operation_log_key));
+ LOG_WARNING(msg)
+ .tag("instance_id", instance_id)
+ .tag("table_id", request->job().idx().table_id());
+ return;
+ }
+ // Put versioned operation log for compaction to track recycling
+ LOG_INFO("put versioned operation log key")
+ .tag("instance_id", instance_id)
+ .tag("operation_log_key", hex(operation_log_key))
+ .tag("tablet_id", tablet_id)
+ .tag("value_size", operation_log_value.size())
+ .tag("recycle_rowsets_count",
compaction_log.recycle_rowsets().size());
+ versioned_put(txn.get(), operation_log_key, operation_log_value);
+ }
}
void process_schema_change_job(MetaServiceCode& code, std::string& msg,
std::stringstream& ss,
std::unique_ptr<Transaction>& txn,
const FinishTabletJobRequest* request,
FinishTabletJobResponse* response,
TabletJobInfoPB& recorded_job,
std::string& instance_id, std::string& job_key,
bool& need_commit,
- std::string& use_version, bool
is_versioned_read) {
+ std::string& use_version, bool
is_versioned_read,
Review Comment:
最后的两个参数没有对齐, 要不都带enabled后缀要不都不带
--
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]