perf/harden: reconcile-hourly loads unbounded read tables + double-writes per new reconciliation #60
Labels
No labels
bug
enhancement
pr-split
question
security
transaction-matcher
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
momsse/octant#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surfaced by the local
/code-reviewduring #55 (pre-existing; not introduced there).ReconcileHourlyUseCaseImpl.execute(reconcile-hourly.use-case.ts):findAllMatchCandidates()+findAllReconciliations()pull the entire tables into the API heap and rebuild Sets over all rows every hourly run; cost grows without bound as the tables accumulate. A candidate query bounded to unreconciled/pending rows (or batched pagination) would cap per-tick cost.proposeReconciliationthenestablishReconciliationissue two separateexecuteCommandcalls on the same reconciliation stream (the establish re-reads what propose just wrote). A single decide emittingCreated+Established(or reusing the loaded state) halves the write I/O.establishedTransactionIds/establishedDocumentIdsderived from the read models, so a just-established (e.g. manual confirm) reconciliation not yet projected can let the job establish a second one for the same transaction/document until the supersede saga (#58) converges. Aligns with the write-side-no-async-read-models principle.Relates to #46 (saga-error helper), #58 (supersession convergence).