Order creation conflict or failure
Safely investigate failed or repeated Order creation requests and Redis coordination issues.
Trigger / Symptom & Blast Radius
POST /api/v1/orders returns 409 Conflict, times out with an ambiguous outcome, fails during concurrent buyer checkouts, or encounters Order Cache and Distributed LocksContainerv1.0.0Order Cache and Distributed LocksRedis-backed coordination and caching slice owned by the Ordering bounded context for buyer-scoped creation locks, HTTP ...Ownercommerce-fulfillment-teamDiagramOpen docs connectivity errors. Blast radius is active checkout submissions; committed orders in Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs remain safe.
Never flush Order Cache and Distributed LocksContainerv1.0.0Order Cache and Distributed LocksRedis-backed coordination and caching slice owned by the Ordering bounded context for buyer-scoped creation locks, HTTP ...Ownercommerce-fulfillment-teamDiagramOpen docs or bulk-delete idempotency or lock keys during an incident. Clearing Redis removes active duplicate-request markers and buyer write locks, risking duplicate orders across concurrent checkouts.
Pre-Flight Check
Before retrying any checkout, query Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs to verify whether the order was already persisted in Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs, and check Redis responsiveness:
curl -sS -H "Authorization: Bearer <ADMIN_TOKEN>" "https://<GATEWAY_HOST>/ordering/api/v1/orders?buyerId=<BUYER_ID>&pageIndex=1&pageSize=10"redis-cli -u "<REDIS_URL>" PINGQuick Recovery Procedure
Capture privacy-safe correlation context
Record
<BUYER_ID>,x-request-id, UTC timestamp,<ENV>, and HTTP status code. Exclude street addresses, emails, and other PII from incident tickets.Classify the conflict or error in Ordering logs
Stream Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs logs filtered by
<REQUEST_ID>and<BUYER_ID>:Terminal window az containerapp logs show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --tail 150409 Conflict: A 1-hour idempotency marker already exists for<REQUEST_ID>. If the order exists in Step 1, return itsorderId; if no order exists, verify whether the original request is still in flight before retrying.Concurrent write lock error: Another checkout for
<BUYER_ID>holds the 1-minute buyer write lock. Wait for it to finish and re-queryGET /api/v1/orders.400 Bad Request: Client omitted the requiredx-request-idheader.429 Too Many Requests: Per-user rate limit exceeded; honorRetry-After.Restore Redis connectivity if unavailable
If logs show Redis timeouts, restore Azure Managed Redis connectivity without flushing keys, then re-verify Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs before advising the customer to retry.
Verification
Confirm Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle,
creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs responds with HTTP 200 and only a single order exists for the checkout attempt:
curl -sS -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer <ADMIN_TOKEN>" "https://<GATEWAY_HOST>/ordering/api/v1/orders?buyerId=<BUYER_ID>&pageIndex=1&pageSize=1"Expected output:
200Rollback / Escalation
- Rollback: Do not manually delete persisted orders; use standard administrative cancellation (
PATCH /api/v1/orders/{id}/cancel) if a duplicate order was created externally. - Escalation: Escalate persistent Redis outages to Platform Engineering TeamTeamPlatform Engineering TeamPlatform team providing BookWorm's thinnest viable platform—orchestration, messaging fabric, scheduling, notifications, ...Open docs; escalate idempotency or lock bugs to Commerce Fulfillment TeamTeamCommerce Fulfillment TeamStream-Aligned team owning customer shopping baskets, checkout coordination, order lifecycle, and financial saga orchest...Open docs.
Related documentation
- User CheckoutFlowv1.0.0User CheckoutAn authenticated customer checks out a persisted basket through Ordering API; Finance coordinates asynchronous basket cl...Ownercommerce-fulfillment-teamView flowOpen docs — Checkout validation and snapshot locking.
- ADR-001: Use PostgreSQL as the Order system of recordDecision Recordv1.0.0ADR-001: Use PostgreSQL as the Order system of recordPostgreSQL is the authoritative store for Buyer profiles and accepted Orders; Redis and read projections do not own this...Ownercommerce-fulfillment-teamOpen docs — Authoritative role of Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs.