hust-hhb commented on code in PR #47766:
URL: https://github.com/apache/doris/pull/47766#discussion_r1954071983
##########
be/src/olap/compaction.cpp:
##########
@@ -1439,11 +1444,26 @@ Status
CloudCompactionMixin::execute_compact_impl(int64_t permits) {
return Status::OK();
}
+int64_t CloudCompactionMixin::initiator() const {
+ return HashUtil::hash64(_uuid.data(), _uuid.size(), 0) &
std::numeric_limits<int64_t>::max();
+}
+
Status CloudCompactionMixin::execute_compact() {
TEST_INJECTION_POINT("Compaction::do_compaction");
int64_t permits = get_compaction_permits();
- HANDLE_EXCEPTION_IF_CATCH_EXCEPTION(execute_compact_impl(permits),
- [&](const doris::Exception& ex) {
garbage_collection(); });
+ HANDLE_EXCEPTION_IF_CATCH_EXCEPTION(
+ execute_compact_impl(permits), [&](const doris::Exception& ex) {
+ auto st = garbage_collection();
+ if (!st.ok() && initiator() !=
INVALID_COMPACTION_INITIATOR_ID) {
+ // if compaction fail, be will try to abort compaction,
and delete bitmap lock
+ // will release if abort job successfully, but if abort
failed, delete bitmap
+ // lock will not release, in this situation, be need to
send this rpc to ms
+ // to try to release delete bitmap lock.
+ _engine.meta_mgr().remove_delete_bitmap_update_lock(
Review Comment:
Yes, this pr just try to release lock, it may fail on TXN_KV_CONFICT, this
problem has existed for a long time, if release rpc fail, this lock will be
released when lock is expired.
--
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]