how2how2how2-arch commented on issue #76735: URL: https://github.com/apache/airflow/issues/76735#issuecomment-6757546941
The fresh-token route covers the second case, so the question is what it costs, and the cost sits in one sentence of the body: that the worker runs the callback only after its start report is acknowledged. Read the other direction on that sentence. If the worker stays alive and the acknowledgement is what gets lost, the callback does not run. The row then reads as a callback in progress rather than a missed one, which is the same shape as the failure this issue is about: nothing visibly failed and the deadline went unannounced. So that ordering buys never-twice at the price of sometimes-never. Whether that is a good trade depends on what the effect is, and for a deadline callback it is usually a notification, where running twice is noise and running zero times is the bug being fixed. That asymmetry is my argument for making the guarantee at-least-once with an attempt identity the effect can dedupe on, rather than exactly-once: neither case then needs a report round trip sitting in the path. If you do want exactly-once, the clock needs an owner, and that is the part the body assumes rather than names. On main nothing outside `handle_event` writes a terminal state, so a row that was exchanged and never reported started is only detectable by something scanning RUNNING rows that carry no start stamp. That scanner is worth having regardless of which design wins, because it is the only thing that would ever make the stuck row visible at all. One note on the row itself: there is no attempt or nonce column today. The closest existing idiom is `processor_claim_id`, a UUID written alongside the state change, and both designs want exactly that shape. Which means the compare-and-set is one statement over (state, claim id) and not two writes over state; if they are two, the window between them is where a re-dispatch and a start report can both win. Same for the exchange route, where `state` is the only thing set before the execution token is issued, so the attempt identity has to be written in that same statement or the token and the attempt can be reporting different attempts. -- 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]
