Open
Description
Hi Team,
I wanted to start a discussion about how we can implement this, but didn't want to write a full RFC. Long story short, coderd replica has to send a notification when the workspace is scheduled for deletion (3d, 1d, 30min).
Proposal
Let's implement event deduplication similar to Event Sourcing.
- Every replica periodically checks if the workspace is scheduled for deletion, and its owner should be notified.
- In the worst case, all replicas take the same decision to insert
notification_message
. - Every notifier follows the same process:
3.1 Fetch messages usingAcquireNotificationMessages
.
3.2 For every message: identify its type and call optional logic to verify if delivered.
3.3 If already delivered, then skip delivery.
3.4 Call optional delivery callback.
Verification logic and delivery callback depend on the notification type. For "queued for deletion" it could check against the database column notified_deleting_at
. The value is updated by delivery callback.
Let me know your thoughts!