Worked case · Waking up elsewhere
Retrying a write when the answer was lost
What changes when the same write is sent twice because the first answer never arrived?
You send a write named r1. The answer never arrives. You do not know whether the write happened, so you send r1 again.
- write r1answer lost
- write r1 againreceipt for A
- 1 · Aedition
- view: Aposition 1
Replay these in your head or in your own code, starting from the saved position. They are synthetic. There is nothing to install and nothing to send.
{
"initial": {
"read_bookmark": 0,
"visible": [],
"withdrawn": [],
"logical_writes": 0
},
"steps": [
{
"delivery": "response_lost",
"operation": "r1"
},
{
"delivery": "retry",
"response": {
"kind": "write_receipt",
"operation": "r1",
"id": "A"
}
},
{
"delivery": "changes",
"events": [
{
"seq": 1,
"kind": "edition",
"id": "A"
}
],
"continuation": 1
}
]
}Work it out before you look.
Reveal the expected viewHide the expected view
Nothing happens twice. The retry carries the same operation name, r1, so it returns the receipt for the same edition, A. One edition is visible and one write is counted.
{
"read_bookmark": 1,
"visible": [
"A"
],
"withdrawn": [],
"logical_writes": 1
}