Skip to content

Add configurable database read fault injection and a cross-driver recovery benchmark - #40

Open
KeyCOrigin wants to merge 6 commits into
OpenDCAI:mainfrom
KeyCOrigin:dev02
Open

KeyCOrigin wants to merge 6 commits into
OpenDCAI:mainfrom
KeyCOrigin:dev02

Conversation

@KeyCOrigin

Copy link
Copy Markdown

Summary
This PR builds on the database read recovery changes in #39. It adds opt-in fault injection and a benchmark for verifying how DataMind handles SQLite, MySQL, and PostgreSQL errors under different failure conditions.
Changes

  • Add fault injection to the shared read-only SQL execution path. Experiments can configure the error type, failure probability, outage duration, and delay before the error is returned.
  • Extend the robustness runner to record query attempts, injected failures, and actual SQL executions separately.
  • Add benchmark.sql_errors to compare raw driver exceptions and SQLAlchemy-wrapped exceptions with retries enabled and disabled.
  • Add PostgreSQL cases for administrator shutdown (57P01) and lock unavailability (55P03). Both document the current single-attempt behavior under the existing retry policy.
    Validation
    The default matrix defines 440 checks with the optional MySQL and PostgreSQL drivers installed.
  • 420 simulated checks cover 35 error types, two exception formats, two retry policies, and injection probabilities of 0%, 30%, and 100%.
  • 20 native SQLite checks cover SQL errors and real lock contention, including recovery after lock release and retry-budget exhaustion under persistent locking.
    MySQL and PostgreSQL cases use PyMySQL and Psycopg exception objects to verify error classification and retry control flow. The benchmark connects only to a local SQLite database.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant