github-actions[bot] commented on code in PR #62272:
URL: https://github.com/apache/doris/pull/62272#discussion_r3090725386


##########
gensrc/thrift/Status.thrift:
##########
@@ -115,6 +115,7 @@ enum TStatusCode {
 
     // used for cloud
     DELETE_BITMAP_LOCK_ERROR = 100,
+    SC_COMPACTION_CONFLICT = 101,

Review Comment:
   `TStatusCode` is a shared FE/BE thrift enum, so adding a new wire value 
needs rolling-upgrade compatibility. With this change, a new BE can report 
`SC_COMPACTION_CONFLICT` to an old FE through `TFinishTaskRequest.task_status`; 
old Java thrift bindings will not know enum value `101`, and 
`MasterImpl.finishTaskInternal()` dereferences `taskStatus.getStatusCode()` 
directly (`!= TStatusCode.OK` and `.toString()`). That makes the new code 
unsafe for mixed-version FE/BE operation. Please either reuse an 
already-compatible retryable wire code or add compatibility handling on the FE 
side before introducing a new shared enum value.



##########
be/src/cloud/cloud_schema_change_job.cpp:
##########
@@ -172,8 +171,15 @@ Status CloudSchemaChangeJob::process_alter_tablet(const 
TAlterTabletReqV2& reque
                              << ", tablet_id=" << _new_tablet->tablet_id() << 
", rowset=["
                              << v.first << "-" << v.second << "]"
                              << ", alter_version=" << 
start_resp.alter_version()
-                             << ", job_id=" << _job_id << ". Will retry with 
higher alter_version.";
-                return Status::Error<ErrorCode::INTERNAL_ERROR>(
+                             << ", job_id=" << _job_id << ". Aborting SC job 
and retrying.";
+                // Abort the SC job so the next retry can register with a 
higher alter_version.
+                auto abort_st = 
_cloud_storage_engine.meta_mgr().abort_tablet_job(job);
+                if (!abort_st.ok()) {
+                    LOG(WARNING) << "failed to abort SC job after cross-V1 
detection"
+                                 << ", tablet_id=" << _new_tablet->tablet_id()
+                                 << ", error=" << abort_st;
+                }
+                return Status::Error<ErrorCode::SC_COMPACTION_CONFLICT>(

Review Comment:
   Returning `SC_COMPACTION_CONFLICT` even when `abort_tablet_job()` failed is 
not safe. FE retries this by resending the same `AlterReplicaTask`, so BE keeps 
the same `job_id`, and `start_schema_change_job()` treats the same `(id, 
initiator)` as an idempotent restart and returns the previously recorded 
`alter_version` instead of registering a fresh job 
(`cloud/src/meta-service/meta_service_job.cpp`, lines 420-425). If the abort 
RPC failed before clearing the schema-change job in meta-service, the next 
retry comes back with the same stale V1 and can loop on this check until FE 
exhausts the retry budget. Please propagate `abort_st` here, or only swallow 
the specific already-gone case after proving the old job is no longer recorded.



-- 
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]

Reply via email to