Skip to content

Harden DB writes against partial table loss - #52

Draft
jeanconn wants to merge 2 commits into
stack/04-detection-methodsfrom
stack/05-db-write-hardening
Draft

Harden DB writes against partial table loss#52
jeanconn wants to merge 2 commits into
stack/04-detection-methodsfrom
stack/05-db-write-hardening

Conversation

@jeanconn

Copy link
Copy Markdown
Contributor

Description

Harden DB writes against partial table loss.

These issues kept popping up in local repro work so collected some solutions.

  • make DB writes resilient to partial failures so one bad write does not silently
    destroy table state
  • fix region-id allocation so add_regions() does not reuse IDs when
    last_region_id is absent, stale, or behind the current table contents
  • repair duplicate region_id values during region-table sync while keeping
    destination IDs stable where possible
  • trim oversized region snapshot coverage into a more focused dedicated test module

Interface Impacts

  • DB write failures should now be more explicit and less likely to leave tables in a
    partially replaced state
  • region tables should no longer hand out duplicate numeric IDs or reissue
    retired ones during add/sync operations

Testing

  • expands DB unit coverage for partial-write recovery and adds focused region tests
    for region_id allocation, stale counters, and sync-time duplicate repair

Unit tests

  • No unit tests
  • Mac
  • Linux
  • Windows

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

No functional testing.

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