Skip to content

NoveltyAtMax backpressure surfaces as HTTP 400 InvalidTransaction — retrying clients silently drop the write #1708

Closed

Description

@aaj3f

Small one, but I think it's a genuine footgun for any client doing sustained writes.

When novelty hits reindex_max_bytes, the backpressure check is a hard error (no queue, no wait — fluree-db-transact/src/stage.rs:626-632), and by the time it reaches the HTTP surface it's been folded into the catch-all transact error arms (fluree-db-server/src/error.rs:149, :250): the client sees HTTP 400 err:db/InvalidTransaction. The retryable carve-outs at error.rs:144-147 cover only CommitConflict/PublishLostRace/NamespaceConflict, so NoveltyAtMax — which is the most retryable condition we have, "the indexer just needs a moment" — is excluded.

Consequence: a well-behaved client that retries 5xx and treats 4xx as permanent (i.e. basically every HTTP client) drops the write. For an ingest pipeline that's a silent-data-loss shape: the writes that arrive while the indexer is catching up get classified as malformed transactions and discarded by the caller.

The pieces to fix it mostly already exist, which is the mildly frustrating part:

  • err:db/NoveltyAtMax is defined at fluree-vocab/src/errors.rs:62 and referenced nowhere.
  • The docs at docs/operations/configuration.md:405-412 say reaching reindex_max_bytes "blocks commits until reindexed" — it doesn't block, it errors. The comment at fluree-db-api/src/server_defaults.rs:44 says "block" too. So the docs describe the behavior we probably wish we had, which is its own small trap for anyone capacity-planning off them.

Suggested shape (happy to take this myself; it's small):

  1. Map TransactError::NoveltyAtMax to 503 + Retry-After with the already-defined err:db/NoveltyAtMax code, leaving 400 for actually-invalid transactions.
  2. Fix the two "blocks" claims in docs/comments to describe the real (erroring) behavior — or, if we'd rather make the docs true instead, that's a bigger conversation about a bounded wait on the commit path, which I don't think we should couple to this fix.
  3. A regression test pinning the status code + error code, since the current mapping exists only by falling through catch-alls.

This is more of a bug report than a design proposal — but if anyone feels 503 is wrong for "storage-layer says slow down" (429 is the other candidate), happy to talk it through before the PR.

Activity

  1. aaj3f commented on Aug 28, 2026

    @aaj3f
    ContributorAuthor

    Correcting my own record here, prompted by review verification on #1719: the pre-fix behavior was worse than this issue describes. The 400 err:db/InvalidTransaction pair I reported holds only on the direct ApiError::Transact path — which the HTTP routes never take. On the consensus-flattened path every real transact request uses, the variant's status survived flattening but its type didn't: error_type()'s Http arm mapped only {401, 403, 409, 422}, so the response was actually

    {"error":"Transaction error: Novelty at maximum size, reindexing required","status":400,"@type":"err:system/InternalError"}

    — a capacity condition reported as a client error with an internal-error type, the worst of both. bplatz caught this by reverting the fix and measuring; Claude re-verified the mapping chain against origin/main and it's exact. #1719 (merged mapping + docs reconciliation) fixes both halves; noting it here so anyone reading this issue later has the accurate pre-fix picture.

  2. Jackamus29 commented on Aug 28, 2026

    @Jackamus29
    Contributor
  3. added a commit that references this issue on Sep 3, 2026
    8032ba7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions