3 ms·
Isn't there a race condition in the check, though? * X in transit to B * A asks B: Have you received X? B says No. * X gets to B. * A sends X.
by losvedir 2y ago
Isn't there a race condition in the check, though?
* X in transit to B
* A asks B: Have you received X? B says No.
* X gets to B.
* A sends X.
- 3np 2y agoRight, and as you solve for this on a different layer, you end up having to choose between at-most-once and at-least-once at some point anyway. Proof is in the pudding if GP won't take my word for it ;) I think it's a useful excercise to attempt to disprove notions such as this. We shouldn't take all these "truths" for granted. But it does take some diving into it properly to appreciate the nuances and eventually get the underlying (as opposed to reasoning about it on a higher level, as we all are here).
- benlivengood 2y agoI've worked on a couple systems that achieve exactly-once processing and one took a at-most-once writing approach that backfilled missing events after the fact (6 nines of completeness was sufficient for ~hours), and another that took the approach of file-chunk ownership with retries by another worker if the destination files (distributed file system in another region) were too short once ownership expired, before chunks were marked fully complete and the next chunk was added to the work queue (transactionally).
- benlivengood 2y agoThere is multiple delivery if there are multiple senders, which can be avoided on the sending side by e.g. individual send-workers owning messages with a TTL and cancelling if they can't increase their ownership TTL if they haven't finished by the expiration