You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Peer write relay: wait until the peer has applied the commit, and return a status handle on timeout #2452
P2Scheduled: real but not urgentarea:serverHTTP surface, routes, error mapping, swagger, timeouts/admission, config graphenhancementNew feature or request
A query peer forwards a transaction to its transaction server over HTTP, waits for the server's response (up to 300 s), and relays it. Two things are missing from that path:
Read-your-writes on the peer. The peer replies as soon as the transaction server has committed, before the peer has applied that commit itself. A client whose next query goes to the same peer can miss its own write unless it sends the receipt's t back as Fluree-Min-T.
A handle when the forward times out. A forward that times out returns a bare 504, with nothing for the client to check later. Idempotency-Key with /submissions/:key/*ledger reports a submission's outcome. But it works only when the client sent a key, and a peer answers the status route itself, from an idempotency cache it doesn't have, so through a peer the status is always unknown.
Proposal
On a peer, for every forwarded transaction:
Use the client's Idempotency-Key, or mint one when there is none, and forward with it.
Once the transaction server answers with a commit, wait (bounded by the existing min-t timeout) until the peer's own view of the ledger reaches the receipt's t, then reply. The peer already tracks each ledger's t from the event stream, and min-t waits use the same mechanism.
If the forward times out, or the peer's view doesn't reach t in time, reply 202 Accepted with the idempotency key and the status URL, rather than 504.
Forward /submissions/:key/*ledger to the transaction server, which holds the outcome.
Open questions
Whether step 2 is the default or opt-in (for example a header). It adds the peer's apply latency to every forwarded write.
How long the transaction server keeps an outcome in its idempotency cache, and what the status route reports once it's gone. The commit log is the fallback.
Context
From the review of #2409, which forwards the nameservice sync routes from peers to the transaction server.
P2Scheduled: real but not urgentarea:serverHTTP surface, routes, error mapping, swagger, timeouts/admission, config graphenhancementNew feature or request
Activity