Skip to content

Preserve scan data and aggregate counts after database failures #448

Closed

Description

@somethingwithproof

Three failure paths remain after #427/#437 and #447:

  • A normal scan load ignores failed reads or inserts, can exchange an incomplete staging table, and lets the poller clear the complete temporary source.
  • An interrupted aggregate rebuild replays additive counts from its retained source. With source counts of 10 and 20, failure on the second date followed by a retry produces 40 instead of 30. A failed final source-table drop has the same replay problem.
  • Rebuilding scan dates can delete valid dates after a partition read fails and then report success.

Reproduced locally with PHP 8.5.12 and MariaDB 11.8.9, injecting query failures at the Cacti database adapter boundary. No production database was used. Related: #426, #359.

The prepared fix propagates scan-load failures, stops incomplete date reconciliation, and restarts marked aggregate copies from their intact source. It keeps #447's no-transaction/no-source-row-deletion design. Unmarked, interrupted migrations with two populated tables are retained for recovery because older workers may already have drained part of the source. Regression tests cover failure paths, retry results and the poller cleanup decision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions