Ryan19929 opened a new pull request, #66986:
URL: https://github.com/apache/doris/pull/66986

   ### What problem does this PR solve?
   
   Issue Number: #66982
   
   Related PR: none (first of a serial PR0–PR5 series)
   
   Problem Summary:
   
   `BackupJob` persists the tables and partitions selected by a BACKUP 
statement in the FE edit log.
   After `TableRef` was migrated to `TableRefInfo` (#56095), the replacement 
fields did not retain the
   serialized names used by the historical payload. Because Doris' Gson 
configuration only serializes
   fields annotated with `@SerializedName`, affected FE versions wrote each 
table reference as an empty
   JSON object (`"ref": [{}]`). After an FE restart, a PENDING job was replayed 
successfully but
   repeatedly threw a `NullPointerException` with no business context while 
preparing snapshot tasks.
   
   This change restores stable serialized names (`"n"`/`"p"` on `TableRefInfo`) 
and accepts the
   historical table-name keys (`"ctl"`/`"db"`/`"tbl"`) as alternates of the 
canonical short keys, so
   payloads written both before and after the migration replay correctly.
   
   For already-corrupted PENDING journals, the originally requested scope 
cannot be reconstructed safely:
   treating an empty reference as a whole-database request could back up data 
the user did not select.
   Such jobs are therefore cancelled once, before any repository access, 
snapshot task creation, or
   catalog mutation, with an actionable resubmission error. The cancellation is 
persisted to the edit
   log so a second replay does not re-trigger it. Jobs that already moved past 
PENDING are left untouched
   because later states no longer depend on `tableRefs`.
   
   ### Release note
   
   Fix Backup job replay after FE restart when the edit log lost table 
references. Unrecoverable
   historical PENDING jobs are now cancelled once with a clear resubmission 
error instead of failing
   repeatedly with `NullPointerException`.
   
   ### Check List (For Author)
   
   - Test:
       - [x] Unit Test
           - `./run-fe-ut.sh --run 
org.apache.doris.backup.BackupJobTest,org.apache.doris.backup.BackupHandlerTest`
           - 12 tests passed: `BackupJobTest` 9, `BackupHandlerTest` 3; 0 
failures/errors/skips.
       - [x] FE build
           - `./build.sh --fe -j 1`
           - Build success; all 73 Maven modules passed and Checkstyle reported 
0 violations.
   - Behavior changed:
       - [x] Yes. A historical PENDING Backup job whose journal has already 
lost its table references is
         cancelled and must be resubmitted. All other jobs are unaffected.
   - Does this need documentation?
       - [x] No.
   
   Validated on `apache/doris:master@b3b1eab90ca`; PR head: `dcb6d575e4b`.
   


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