Skip to content

[discuss] Implement notification: queued for deletion #10

Open
@mtojek

Description

@mtojek

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.

  1. Every replica periodically checks if the workspace is scheduled for deletion, and its owner should be notified.
  2. In the worst case, all replicas take the same decision to insert notification_message.
  3. Every notifier follows the same process:
    3.1 Fetch messages using AcquireNotificationMessages.
    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!

cc @dannykopping @mafredri

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions