forked from mtusi2026/mtusi2026lab5
chore(lab5): remove stale templates and refresh source comments
This commit is contained in:
@@ -5,8 +5,8 @@ ALTER TABLE attachments DROP CONSTRAINT IF EXISTS attachments_pipeline_version;
|
||||
ALTER TABLE attachments DROP CONSTRAINT IF EXISTS attachments_error_state;
|
||||
ALTER TABLE attachments DROP CONSTRAINT IF EXISTS attachments_status;
|
||||
|
||||
-- Collapse asynchronous states back to lab4's single in-flight state. Ready
|
||||
-- and failed rows keep their meaning; queued/processing work is abandoned.
|
||||
-- Collapse asynchronous states back to the previous single in-flight state.
|
||||
-- Ready and failed rows keep their meaning; queued/processing work is abandoned.
|
||||
UPDATE attachments
|
||||
SET status = 'pending', error_code = NULL
|
||||
WHERE status IN ('queued', 'processing');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- Lab5 turns attachment processing into a durable asynchronous job.
|
||||
-- Attachment processing is a durable asynchronous job.
|
||||
-- The API stages bytes in S3, then in ONE transaction writes the attachment
|
||||
-- snapshot and its outbox/job row. A separate publisher moves the intent to
|
||||
-- RabbitMQ, so a broker outage cannot lose an accepted upload.
|
||||
@@ -6,9 +6,9 @@
|
||||
ALTER TABLE attachments DROP CONSTRAINT IF EXISTS attachments_status;
|
||||
ALTER TABLE attachments DROP CONSTRAINT IF EXISTS attachments_error_state;
|
||||
|
||||
-- Lab4 "pending" meant "object PUT in progress". Nothing can finish it now,
|
||||
-- because lab5 acceptors write "queued" plus a job. Preserve the row for the
|
||||
-- operator instead of silently deleting it.
|
||||
-- The previous "pending" state meant "object PUT in progress". Nothing can
|
||||
-- finish it now, because acceptors write "queued" plus a job. Preserve the row
|
||||
-- for the operator instead of silently deleting it.
|
||||
UPDATE attachments
|
||||
SET status = 'failed', error_code = 'legacy_interrupted', updated_at = now()
|
||||
WHERE status = 'pending';
|
||||
|
||||
Reference in New Issue
Block a user