Skip to main content

Lattice idempotency reconciliation

What it does. Resolves create-then-post idempotency claims that have been Processing for more than 60 minutes: it finalizes, releases or parks each one. Runs: automatically every hour as a background process, and only when such a claim exists. Who looks after it: Integration administrator (the claims it parks, and the on-demand sweep); Integration operator (checks the parked claims and hands them over); System administrator (the background process itself, on a standard page).

Purpose​

Every Lattice posting request holds an idempotency claim on its request ID, so a repeat of the same request never posts twice. Some operations create a journal in one step and post it in a second step. If the server stops between the two, the claim is left Processing, and a caller who repeats the request is refused with "A prior attempt for this RequestId is in an unresolved in-progress (stale) state. It was not re-executed, to avoid a possible double-post. Resolve the idempotency/dead-letter entry (confirm whether the original posted) before resubmitting."

Those claims name the journal they created, so this process can look the journal up and settle the claim without a person: a journal that posted makes the claim succeed, a journal that was never committed frees the request ID, and anything in between is parked for review. Without it, every such claim waits for an administrator on the Stale idempotency claims tile, and the caller stays blocked until then.

When it runs​

  • Every hour. It is one process for the whole environment: it checks each claim in the claim's own legal entity.
  • The database synchronization of a Lattice deployment registers it, and process automation must be initialized in the environment. There is no batch job for you to create.
  • Before it creates a batch job, each poll checks for at least one claim the sweep would take (see the next section). With none, no batch job is created, so most hours leave no trace.

Configuration and scheduling​

SettingWhereDefault
How often it runsSystem administration > Setup > Process automations, Background processes tab: select Lattice idempotency reconciliation and choose Edit, then Repeat interval on the Execution parameters tabEvery hour
A time of day when it does not runThe same dialog, Sleep time period groupNot set by Lattice
How old a claim must beStale threshold (minutes) on the dialog of Idempotency reconciliation sweep, for a run you start yourself; the background process always uses the default60 minutes
Run the sweep nowSystem administration > Periodic tasks > Lattice > Idempotency reconciliation sweep, also the Idempotency reconciliation sweep button on Service idempotency logNone

The background process takes no parameters, so it always runs with the 60-minute threshold. The Process automations page is a standard page that only the System administrator role opens; the sweep from the menu or the button needs the Integration administrator role.

How it works​

  1. Collect the candidates: claims that are Processing, were claimed longer ago than the threshold, name a service and a document table, and are not already parked with Reconciliation state Manual review required. Claims that name no document are left for a person.
  2. Find the handler for the document. Lattice handles three journal families: ledger journals (general, vendor invoice, payment and fixed asset journals), project journals and inventory journals. A claim for any other document is parked.
  3. Look the journal up in the claim's legal entity. If the lookup fails, the claim is parked.
  4. Settle the claim, each in its own transaction, and only if it is still Processing:
What the lookup findsWhat happens to the claimReconciliation state
The journal exists and is postedFinalized: Status Succeeded, so a repeat of the request returns the recorded result instead of posting againResolved - succeeded
No such journal in that legal entityReleased: the claim is deleted, so the caller can send the same request ID again(the claim is gone)
The journal exists but is not postedParked for review; never posted or retried automaticallyManual review required
  1. Summarize with "Lattice idempotency reconciliation completed. Resolved: n, released for retry: n, parked for review: n (of n stale self-describing claims)."

A parked claim is not looked at again by later runs: a person settles it with Mark succeeded or Release claim.

Before it can run​

  • Process automation is initialized in the environment (System administration > Setup > Initialize process automations), and Lattice was deployed with a database synchronization, which registers the process.
  • A batch server is running.
  • The claim names the journal it created. Lattice's create-then-post journal operations write that reference on the claim once the journal exists; a claim left before that point names no journal and is not handled here.

Inputs and outputs​

ReadsChanges
Idempotency claims in Processing older than the thresholdThe claim's Status, Success, Completed time and Reconciliation state, or deletes the claim
The journal the claim names, in the claim's Legal EntityNothing else: it never posts, changes or deletes a journal

Monitoring and logs​

  • System administration > Inquiries > Lattice > Services > Service idempotency log: Status, Reconciliation state, Claimed date/time, Document table, Document ID and Legal Entity. All four Lattice integration roles can open it.
  • On the Integration operations workspace: Stale idempotency claims counts the claims still Processing more than an hour after they were claimed, and Claims needing manual reconciliation counts the claims this process parked.
  • The LatticeServiceIdempotencyLogs entity, readable by all four Lattice integration roles.
  • Process automations, View most recent results: "Lattice idempotency reconciliation finished.", or "Lattice idempotency reconciliation failed. The messages below give the reason; the process runs again at its next interval." with the messages. A poll with nothing to do adds no result.
  • System administration > Inquiries > Batch jobs: the jobs are named Lattice idempotency reconciliation.
  • When Application Insights telemetry is set up: Lattice.Idempotency.SweepCompleted with the counts, Lattice.Idempotency.StaleBacklog (the number of candidates) and Lattice.Idempotency.Reconciled for each claim (ids and the outcome only).

When it fails​

Each claim is looked up and settled on its own, so one failure never stops the run. A claim whose journal cannot be looked up is parked rather than guessed at. A claim that another process or a person settled after the run started is left as it is. A run that fails as a whole is recorded as failed in the process results and runs again at the next interval.

SymptomCauseFix
Stale idempotency claims stays above zero after the hourly runThe claims name no journal, or were parked; or the process is not runningFollow I want to close a claim that is stuck in processing. If none of the claims has ever been settled automatically, check that process automation is initialized and that Lattice was deployed through your build with the database synchronization.
Claims needing manual reconciliation goes upA journal was created but not posted, its family is not handled, or the lookup failedOpen the journal from Document table and Document ID in its Legal Entity: if it is posted, choose Mark succeeded; if the request left nothing behind (or you reversed or deleted it), choose Release claim.
A caller still gets "A prior attempt for this RequestId is in an unresolved in-progress (stale) state. ..."The claim has not been settled yetWait for the next hourly run, run Idempotency reconciliation sweep now, or settle the claim by hand.

Effect on the rest of Lattice​

  • Callers can resend a request only after its claim is settled: this process unblocks most of them within an hour of the claim becoming stale.
  • The recovery of interrupted asynchronous operations reads the same claims: an operation whose claim this process finalized is recovered as Succeeded by Lattice Async Operation Processing.
  • It reads journals and writes only claims, so its load is light. Running the sweep from the menu at the same time is harmless: each claim is settled only while it is still Processing.
  • Succeeded claims are deleted 30 days after they completed by the Lattice integration log cleanup; claims still Processing are never deleted.