File pickup and authorization

  • Follow one physical file registration from competing pollers to staged, authorized rows.
Diagram phase
100%

FileUpload processing · illustrative event order

Contended registrationPhysical load and authorizationOne file registration elects one loaderWork / decisionFiles / durable stateBoth candidate scans may see F. A wins only if F is still pending when locked.After commit, another worker checking F sees initiation and skips the registration.Crash between commit and launch leaves recovery work.Intermediate rows are distinct from created offers.The winning worker receives the outcome of its child process.The load workflow records staged/awaiting authorization on success (5), failure on loader error (2).After successful staging, manual or scheduled authorization moves the file from status 5 to 6 for subsequent row processing.Each participating JVM schedules its own scan. A pending-list read can return the same registration to multiple replicas.Pod pollersOne worker locks the master row, rechecks pending status and commits initiation. Later claimants skip it.File masterThe selected worker launches an OS child after initiation commits. Parent loss can leave the child outcome unknown.SQL*LoaderSuccessful load awaits a separate manual or scheduled authorization before rows can reach creation.Staged rowsA locks and rechecksInitiation committedStart physical loadWrite input rowsLoader resultStaged / failedRelease if authorized

Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.

  • The timer locates candidates. The master-row transaction elects the owner.
  • If the worker exits between initiation and launch, the file master can show initiated while no loader is running.
Physical file pickup and release

Physical file pickup and release

FileUpload work scheduling and Oracle row ownership

One registration, one loader winner

  • A participating servlet starts a scan immediately. Its scheduled task begins after one second and runs at 100-second intervals.
  • An available local worker reserves execution capacity. The poller locks the Oracle file-master row, checks it is still pending, records initiation and commits. A competing poller rechecks and skips a registration already taken.
  • The winning worker launches the standard SQL*Loader child process. On success the file awaits authorization. Manual or scheduled authorization releases its staged records for offer creation.
  • With two FileUpload members, both pollers may see the same pending registration. Only the worker that commits initiation launches SQL*Loader.

Recover the gap before and after child launch

File-master state What can still be true Safe next decision
Initiation committed Worker died before launching the loader, or the child is still running Establish the original attempt’s status before reloading. A missed heartbeat alone cannot prove absence.
Staging rows exist A child left partial output or completed while its parent was unavailable Verify source identity, control totals and the applicable reject policy.
Staged and awaiting authorization Loading succeeded and the business release decision is outstanding Recover that decision without rerunning the physical load.

Proposed attempt-scoped staging

  • Retain the existing file claim lock. Record an attempt ID and immutable input identity at initiation. Scope output to that attempt so a late child cannot contaminate a replacement load.
  • Publish the validated attempt with a conditional update on the current owner and attempt ID. Authorization must select only this published set. Inspect the loader control file and downstream readers before changing the schema.
  • Compare the proposed control totals with the existing authorization decision before enabling enforcement. Test crashes immediately before child launch and after the final row. Cut over one upload type after both paths converge on the same authorized set.
  • On rollback, stop new attempts, drain or quarantine unfinished attempts, and reconcile their staged rows before restoring the earlier reader.
Illustrative loader interruption casesjson
{
  "kind": "IllustrativeLoaderRecoveryCases",
  "registration": "DEMO-F",
  "attempt": 1,
  "proposedPrerequisites": [
    "Recorded input identity and expected control totals for this registration",
    "Staging rows scoped to registration and load attempt",
    "One elected attempt may publish its staged output",
    "Authorization selects only that published attempt"
  ],
  "cases": [
    {"failure": "Owner exits after initiation commits, before child creation", "evidence": "Attempt has no confirmed terminal outcome", "recovery": "Fence prior ownership; establish child absence or isolate a fresh attempt before retry"},
    {"failure": "Child finishes after its parent loses ownership", "evidence": "Staging bytes exist under the old attempt", "recovery": "Reject old completion using a conditional owner/attempt update; keep old rows outside the authorized set"},
    {"failure": "Loader reports success with rejects or a count mismatch", "evidence": "Loader outcome and expected totals disagree", "recovery": "Hold for reconciliation under the file's reject policy"},
    {"failure": "Retry arrives after the staged attempt was published", "evidence": "Published attempt and validated input identity already match", "recovery": "Reuse the recorded result; retain the separate authorization decision"}
  ]
}