Land currently performs several independent operations:
- Allocate a new sqid.
- Write the request receipt and read-model projections.
- Persist the initial
acceptedrequest log. - Publish the request to the processing pipeline.
These operations are not atomic. If one succeeds and a later operation fails, partial state can remain. A client retry allocates a new sqid, so the partial state associated with the previous sqid does not automatically converge.
The primary user-visible concern is a request that appears as accepted in List indefinitely even though it never entered the pipeline.
We do not care about exposing requests that failed before their first accepted request log was successfully persisted.
Change List visibility so a request is not included until its first accepted log has been persisted:
request.ReceiptWriterdoes not create the queue summary used by List.- The request-log materializer creates the queue summary after inserting the first
acceptedlog. - Receipt writes that fail before the accepted log remain invisible to List.
- Small implementation change.
- Directly matches the desired List visibility boundary.
- Avoids arbitrary age thresholds.
- Does not complicate List pagination with response-time filtering.
- If the accepted log succeeds but pipeline publication fails, the request still remains visible as
accepted. - If accepted-log insertion succeeds but projection materialization fails, the log and List projection can remain inconsistent without a retry mechanism.
Apply Option A and also handle pipeline publication failure explicitly:
- Persist an
errorrequest log when pipeline publication fails. - Store the publication failure in
lastError. - Return the Land error to the client.
- Let List show the abandoned sqid as
errorinstead of leaving it permanentlyaccepted.
- Handles the ordinary pipeline publication failure transparently.
- Preserves the receipt history instead of hiding failed accepted requests.
- Requires relatively little additional machinery.
- Gives operators and users an explanation through
lastError.
- If pipeline publication and error-log persistence both fail, the request can still remain
accepted. - Client retries still allocate a new sqid, so the failed sqid and replacement sqid remain separate requests.
- This improves the common failure path but does not provide complete convergence under compound failures.
Separate receipt creation from public acceptance:
- Create the internal receipt with status
accepting. - Exclude
acceptingrequests from List, Status, and History. - Publish the request to the pipeline.
- Persist
acceptedonly after publication succeeds. - Allow any
acceptedor later pipeline event to activate and repair the public projections.
- Gives public APIs a clear semantic boundary.
- Admission attempts that never reach the pipeline remain hidden.
- Later pipeline events can repair a missed accepted transition.
- Requires additional state, filtering, materializer behavior, race handling, and tests.
- A pipeline consumer can emit a later event before Land persists
accepted, so event ordering must be handled carefully. - If publication succeeds but accepted persistence fails, the client may still retry and create another sqid.
Design Land as a recoverable admission workflow:
- Add a client-provided idempotency key.
- Reuse the same sqid when the client retries the same Land operation.
- Persist a durable publication intent.
- Retry pipeline publication until it succeeds or reaches a terminal failure.
- Make projection materialization replayable from retained request events.
- Client retries converge on one logical request and one sqid.
- Partial failures can be recovered rather than merely hidden.
- Provides the strongest production semantics.
- Supports reliable projection repair and operational reconciliation.
- Requires API and schema changes.
- Requires a publication worker or reconciler.
- Requires lifecycle, retention, retry, and terminal-failure policies.
- Has substantially greater implementation and operational complexity.
Hide or transition requests that remain accepted beyond a configured age.
- Straightforward operational model.
- Can remove obviously stale requests from the common List view.
- An old accepted request is not necessarily abandoned. It might be legitimately waiting in a backed-up queue.
- List filtering hides incorrect state without repairing Status, History, or storage.
- Filtering after reading a page complicates pagination because hidden rows still consume storage query limits.
- A sweeper needs a reliable signal that publication did not occur, not merely an elapsed-time threshold.
This option is not recommended unless SubmitQueue defines a guaranteed maximum duration for the accepted state.
Use Option B for the current pre-production stack:
- Create the List projection only after the first
acceptedlog is persisted. - If pipeline publication fails, persist an
errorlog withlastError. - Return the publication error so the client can retry with a new request.
Document Option D as the intended production direction if stronger retry convergence becomes necessary.
This provides a small and understandable improvement now without introducing the state machine and recovery machinery required by the more complete designs.