Skip to content

unify cluster db store import error handling#55

Merged
fabracht merged 1 commit intomainfrom
cluster-store-import-error-consistency
May 3, 2026
Merged

unify cluster db store import error handling#55
fabracht merged 1 commit intomainfrom
cluster-store-import-error-consistency

Conversation

@fabracht
Copy link
Copy Markdown
Contributor

@fabracht fabracht commented May 3, 2026

Summary

  • Follow-up to PR add partition snapshot exports for schema/index/unique/fk/constraint stores #54 review. All six cluster DB store import_* methods now propagate SerializationError on deserialize failure. Previously IndexStore::import_entries propagated via ? while DbDataStore, SchemaStore, ConstraintStore, UniqueStore, and FkValidationStore silently skipped malformed entries — a corrupt snapshot stream would either truncate or abort depending on which store hit the bad bytes first.
  • Fixed IndexStore::import_entries counter accuracy. It used to increment imported even when add_entry returned Err(AlreadyExists), inflating the count on idempotent snapshot replay. Now only successful inserts are counted; AlreadyExists is treated as benign replay (so a second import of the same payload returns Ok(0)), and any other error variant propagates.
  • Updated # Errors docstrings on all six methods to accurately reflect the failure modes (UTF-8 key parse failure and entity deserialize failure).
  • New regression test import_entries_is_idempotent_on_replay in index_store.rs covers the counter fix.
  • mqdb-cluster 0.3.2 → 0.3.3, CHANGELOG entry under 2026-05-03.

Test plan

  • cargo test -p mqdb-cluster --lib — 466 passed (465 prior + 1 new test)
  • cargo make clippy — clean (pedantic, all targets + wasm)
  • cargo make format-check — clean
  • cargo make dev — full workspace passes
  • Pre-commit hook (format-check + clippy) ran on the commit and passed

@fabracht fabracht merged commit 980598d into main May 3, 2026
5 checks passed
@fabracht fabracht deleted the cluster-store-import-error-consistency branch May 3, 2026 22:15
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