Skip to content

Rate-limit Event Ledger #6- Wire-Up to Cassandra #2153

Description

@adi0106

Description

Connects the cache to the real Cassandra handler by wrapping DBHandlerV2 with CachingDBHandler in registrations.go and implementing the flush callback: when the timing wheel fires for a pending entry, the latest value is written to Cassandra using the event's own timestamp. This is the only PR that changes what gets written to Cassandra in the running service.

Definition of Done

  • CachingDBHandler wraps the Cassandra DBHandlerV2 in registrations.go
  • Cache config fields are read from config.yaml and passed through at startup
  • On a timing wheel tick, all pending entries in the fired slot are flushed to Cassandra
  • Flush uses the event's own timestamp so Cassandra's IF timestamp < ? guard remains effective
  • A failed flush leaves the entry pending and reschedules it
  • Pending state is cleared only after a confirmed successful write
  • An event that arrives during a flush is not lost
  • Existing v3_test.go tests continue to pass unchanged

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions