[P0-06] Make CouchDB ingest/update persistence and downstream publication crash-safe #14
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-server#14
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?
Confirmed data-loss windows
New document ingest
handle-new-documentcurrently performs:documents.new.<dtype>If publication fails after the insert, the delivery is requeued. On retry, CouchDB returns conflict; the conflict handler NACKs with
requeue nil, so the downstreamdocuments.newevent is permanently lost. A process crash in the same interval has the same failure mode.Document update
handle-updateperforms the same unsafe sequence:documents.updated.<dtype>A publish failure or crash after persistence can cause a retry/conflict loop, duplicate mutation attempts, or a persisted update with no downstream event.
Required changes
Choose and document a recoverable pattern, preferably a CouchDB-backed outbox or an idempotent mutation record with publication state.
Requirements:
Acceptance tests
documents.newevent.documents.updatedevent for that mutation.Active implementation: PR #65 (
agent/issue-14-couchdb-outbox).The branch adds an embedded CouchDB transactional outbox, stable mutation/event IDs, duplicate-versus-conflict detection, separate ingest/update and downstream routes, pending-event recovery, per-document sequence ordering, and forced-failure/restart regression coverage. Waiting on required fixture and CLOS/outbox conformance CI.
Completed via merged PR #65.
Validation:
Merge commit:
98d9fff0caa0d10f3f1140d2ec94484ede8f02c6.