Doris-Breakwater commented on issue #71076:
URL: https://github.com/apache/doris/issues/71076#issuecomment-7209618222

   Breakwater-GitHub-Analysis-Slot: slot_c8ee8bbf183a
   
   **Triage.** The 4.1.5 source confirms an FE checkpoint durability bug. The 
reported matching prefix, missing `COR1` footer, and successful push before 
host power loss are consistent with losing unflushed writes. The exact storage 
writeback sequence remains an inference from those observations.
   
   - On the receiving FE, `MetaService.put` downloads to `image.N.part`. 
`MetaHelper.getRemoteFile` closes the stream and checks the byte count and MD5. 
Those checks can pass while writes are still cached. `MetaHelper.complete` 
renames the file without syncing either the file or its directory, and `/put` 
can return success. The helper-based startup pull uses the same code and only 
fetches an image if the helper advertises a strictly higher sequence. The same 
download and rename gap is present at `e46677d800` and in the checked 
`branch-3.1`, `branch-4.0`, `branch-4.1`, and `branch-4.2` sources. [4.1.5 
download](https://github.com/apache/doris/blob/917b20be83878e98f94e3ebf7efccc80346e3e50/fe/fe-core/src/main/java/org/apache/doris/master/MetaHelper.java#L157-L201)
 · [4.1.5 startup 
pull](https://github.com/apache/doris/blob/917b20be83878e98f94e3ebf7efccc80346e3e50/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java#L2243-L2273)
   - Startup picks the highest numbered image and loads it before opening BDB 
JE. With the footer missing, `MetaFooter.read` takes its legacy checksum path. 
The checksum failure then propagates out of `Env.loadImage` on each restart. 
That explains how one failed follower can cost a two-voter FE group its 
majority. [Startup 
order](https://github.com/apache/doris/blob/917b20be83878e98f94e3ebf7efccc80346e3e50/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java#L1196-L1203)
 · [Footer 
parsing](https://github.com/apache/doris/blob/917b20be83878e98f94e3ebf7efccc80346e3e50/fe/fe-core/src/main/java/org/apache/doris/persist/meta/MetaFooter.java#L58-L85)
   
   **PR review.** The ordering in draft #71077 addresses the gap. Force the 
temporary file before publishing it, sync the image directory after rename, and 
acknowledge `/put` only after both syncs succeed. Add a crash test around the 
rename and directory sync. After restart, any selected final image should pass 
full validation. Inject file and directory sync errors too, and verify that the 
master records the push as failed and skips journal pruning for that round. For 
the master-side `Env.saveImage` change, also test a directory sync failure 
after rename. The final name is already visible, the call throws before 
`Checkpoint` receives its path for cleanup, and the next attempt can skip the 
same checkpoint based on the filename alone. [Draft 
diff](https://github.com/apache/doris/pull/71077/files) · [Checkpoint retry 
check](https://github.com/apache/doris/blob/e46677d800/fe/fe-core/src/main/java/org/apache/doris/master/Checkpoint.java#L109-L125)
 · [Checkpoint cleanup](https://github.c
 
om/apache/doris/blob/e46677d800/fe/fe-core/src/main/java/org/apache/doris/master/Checkpoint.java#L168-L206)
   
   **Startup fallback.** Consider it separately. A valid previous image is 
usable only with contiguous committed journal coverage from `imageSeq + 1` 
through the recovery target. The 4.1.5 pruning cutoff depends on the 
pre-checkpoint second-newest image and the other FEs' replay positions, so the 
report of pruning alone cannot establish which entries survived. Test any 
fallback with a fresh metadata state because the failed load can already have 
changed the catalog and replay position. [Journal 
pruning](https://github.com/apache/doris/blob/917b20be83878e98f94e3ebf7efccc80346e3e50/fe/fe-core/src/main/java/org/apache/doris/master/Checkpoint.java#L264-L319)
 · [Image 
loading](https://github.com/apache/doris/blob/917b20be83878e98f94e3ebf7efccc80346e3e50/fe/fe-core/src/main/java/org/apache/doris/persist/meta/MetaReader.java#L71-L133)
   
   For a targeted validation, could you share the sanitized master and follower 
checkpoint logs around the push and reboot, the filesystem and backing 
volume/cache setup for `meta_dir`, and the retained JE journal range on the 
follower? The follower's `put image` log is emitted before the download, so the 
master's push result and pruning cutoff are especially useful. To verify 
fallback for this incident, check that journal `137500572` and every subsequent 
committed entry through the recovery target are readable. [Follower request 
handler](https://github.com/apache/doris/blob/917b20be83878e98f94e3ebf7efccc80346e3e50/fe/fe-core/src/main/java/org/apache/doris/httpv2/meta/MetaService.java#L191-L221)
   


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