Skip to content

Implement reconciliation job for dual-write dirty IDs #1904

@tphakala

Description

@tphakala

Background

During dual-write mode, if V2 delete fails after legacy deletion succeeds, the detection ID is marked as "dirty" for later reconciliation.

Current State

  • Location: internal/datastore/v2/repository/dual_write.go:283
  • The dirty ID tracking works for migration phase failures
  • No periodic reconciliation job exists for dual-write failures during live operation

Proposed Solution

  1. Implement a periodic "Retry Dirty IDs" task that:

    • Scans for dirty IDs
    • Attempts to reconcile V2 state with legacy
    • Clears dirty flag on success
    • Logs failures for manual investigation
  2. Consider running this:

    • On a configurable interval (e.g., hourly)
    • At startup to catch any pending dirty IDs

Acceptance Criteria

  • Periodic reconciliation job implemented
  • Configurable interval
  • Proper logging and error handling
  • Tests for reconciliation logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions