Reconcile Expected Requests Against Success Logs
Build a resumable read-only audit over database IDs and distributed success logs, distinguishing missing success evidence from incomplete coverage.
Problem statement
For this exercise, assume an application database supplies a complete immutable snapshot of the logical requests admitted during a selected incident interval. Successful application requests are also recorded in logs produced by a distributed server fleet.
An authorized operator wants a reproducible report comparing those expected IDs with success observations, without replaying requests or changing the application records. Audit job and report state can be stored separately.
For this exercise, assume every logical request has a globally unique tenant-scoped ID, and log records contain that ID, an attempt identity and an observed terminal-success result. Retries can generate duplicate records for one logical request.
The operator supplies a half-open incident interval, a fixed audit cutoff, a database snapshot identity and a versioned manifest of immutable log objects. The manifest names the expected producers and ranges and their closed coverage through the cutoff; an object key alone is not an immutable input identity.
Unless routing evidence narrows a request to specific producers, all listed producers are relevant.
Return three distinct report classes: observed-success when a valid matching success observation exists; no-success-observed when no such observation exists and all relevant producer ranges through the cutoff are closed, readable and valid; and unknown when absence cannot be judged because coverage is missing, corrupt, late or untrusted.
These classes describe evidence. No-success-observed does not prove that the business operation failed, and neither provider acknowledgment nor a server success proves an end user received anything. Unexpected IDs are separate diagnostics, not additions to the expected set.
For this exercise, bind each audit and report to one immutable input revision. Expose progress, counts, coverage gaps and paginated result IDs; prevent restart or parallel workers from duplicating rows or mixing revisions. Later logs may produce a new report revision but must not silently change an earlier report.
Keep automatic retry of business operations, signing, notification delivery and application-state repair outside scope.
What to build
- An authorized operator can submit an audit for a selected expected-request snapshot and a fixed success-log manifest/cutoff, then recover or cancel the same job.
- The operator can read progress and one versioned paginated report of observed-success, no-success-observed and unknown request IDs, with counts and the coverage used for each claim.
- The operator can identify missing/corrupt producer ranges, malformed observations and unexpected IDs without treating them as evidence that absent operations failed.
- The operator can start a new audit revision for later evidence while retaining the exact inputs and results of the earlier revision.
At scale
- For this exercise, assume one incident spans at most 24 hours and contains up to 100 million expected logical request IDs and 200 million success-log records from 500 expected producers.
- For this exercise, assume IDs are at most 64 ASCII bytes, log records at most 256 bytes, and each worker has 2 GiB RAM. The full input cannot be loaded into one worker memory; input and report objects have immutable generation identities.
- For this exercise, target a complete one-pass report within 30 minutes after healthy frozen inputs are readable. An unavailable or invalid log range may leave request classifications unknown; the target does not imply complete evidence coverage.
- For this exercise, producers and workers may fail independently, logs may arrive late, and operators may retry submissions. Concurrent jobs require bounded admission, and worker restart must not duplicate report rows or counts.