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


##########
be/src/cloud/cloud_schema_change_job.cpp:
##########
@@ -172,8 +171,24 @@ 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.
+                // If abort fails, meta-service still has the stale job and 
retries would be
+                // idempotent (returning the same alter_version). Return a 
non-retryable error
+                // instead, letting FE fail fast rather than burning retries 
on a stale state.
+                auto abort_st = 
_cloud_storage_engine.meta_mgr().abort_tablet_job(job);

Review Comment:
   `abort_tablet_job()` is executed through `retry_rpc()`, but schema-change 
ABORT is not idempotent in meta-service. If meta-service commits the first 
ABORT and the reply is lost/times out, the retry re-enters 
`finish_tablet_job()` after `recorded_job.clear_schema_change()` has already 
run, and `process_schema_change_job()` returns `INVALID_ARGUMENT` / "there is 
no running schema_change" 
(`cloud/src/meta-service/meta_service_job.cpp:1464-1468`).
   
   This branch treats every non-OK abort result as "the stale job is still 
there" and returns non-retryable `INTERNAL_ERROR`, so FE stops retrying even 
though the old job was already cleared and the next `start_tablet_job()` could 
register a fresh higher `alter_version`. That recreates a permanent 
schema-change failure on exactly the transient RPC-loss case this PR is trying 
to fix.
   
   Please make the ABORT result ambiguity-safe here (for example by treating 
the already-aborted / no-running-job result as success, or by making the 
meta-service ABORT path idempotent) and add a test for the "abort committed but 
reply lost" path.



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