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
Raft: identical keyless writes share a queue envelope; the second can fail with 422 #1931
P2Scheduled: real but not urgentarea:serverHTTP surface, routes, error mapping, swagger, timeouts/admission, config graphbugSomething isn't working as expected
On a Raft cluster, sending the same write twice in quick succession without an idempotency key can fail the second with a 422:
submission poisoned: StagingFailed { error: "CAS read of request_cid failed: Not found: fluree:file://<ledger>/<branch>/txn/<hash>.json ...", attempts: 3 }
The first write commits and the second is lost. A client retrying an identical JSON-LD insert hits this, as does any other body kind. It showed up as a roughly 1-in-6 flake in a grp_raft test that re-sent an identical /sync body through a follower.
Cause
QueuedTransactor::enqueue_and_await writes the encoded QueuedRequest to CAS and uses its content hash as request_cid. The server doesn't set CommitOptsRequest.timestamp (only opts.eventTime does), so two identical keyless submissions encode to identical bytes and share one envelope blob.
A keyless entry's envelope is released when its head applies (Response::HeadApplied { released_envelope: Some(request_cid) }, released by the wrapper on each node). So the first submission's release can delete the blob after the second submission has written the same CID and before its worker reads it.
The doc comment on submit_and_await says "unique timestamps per attempt mean retries hash to distinct request_cids". That doesn't hold on this path.
Possible fix
Make every envelope unique, for example with a per-submission nonce or receipt timestamp carried in QueuedTransact and excluded from body_cid, so body-hash dedup is unaffected. Alternatively, reference-count envelope releases. A regression test can submit the same keyless body twice back to back through TestCluster and assert both succeed.
Fixed by #2275 (86ebb9f), released in v4.2.6 and later and on next (v5.0.0-alpha.3 onward). enqueue_and_await stamps each submission with a fresh ULID before it writes the envelope, so two identical keyless submissions no longer share a request_cid. The idempotency body hash leaves the stamp out. Covered by an_identical_queued_request_keeps_its_envelope and a_retry_that_joins_a_queued_entry_releases_its_own_envelope in fluree-db-consensus/tests/it_embedded_node.rs.
P2Scheduled: real but not urgentarea:serverHTTP surface, routes, error mapping, swagger, timeouts/admission, config graphbugSomething isn't working as expected
Activity
bplatz commentedon Nov 22, 2026
Fixed by #2275 (86ebb9f), released in v4.2.6 and later and on
next(v5.0.0-alpha.3 onward).enqueue_and_awaitstamps each submission with a fresh ULID before it writes the envelope, so two identical keyless submissions no longer share arequest_cid. The idempotency body hash leaves the stamp out. Covered byan_identical_queued_request_keeps_its_envelopeanda_retry_that_joins_a_queued_entry_releases_its_own_envelopeinfluree-db-consensus/tests/it_embedded_node.rs.