Skip to content

Enrich RecoveryFailure exception messages with byte positions and ent…#4146

Draft
andrejtonev wants to merge 1 commit into
masterfrom
recovery_errors
Draft

Enrich RecoveryFailure exception messages with byte positions and ent…#4146
andrejtonev wants to merge 1 commit into
masterfrom
recovery_errors

Conversation

@andrejtonev
Copy link
Copy Markdown
Contributor

…ity details

This commit makes all RecoveryFailure exceptions in the durability code substantially more informative by adding:

  1. Byte position (from decoder.GetPosition()) to generic decode errors.

    • Infrastructure: BaseDecoder now exposes GetPosition/GetSize/SetPosition.
  2. Actual entity identifiers (gids, labels, edge types, vertex gids) to wal.cpp LoadWal recovery logic.

  3. Byte positions and gids to snapshot.cpp errors across all load paths.

Previously most errors were bare strings like 'Invalid WAL data!' or 'Invalid edge!'. They now include actionable context that makes debugging corrupted durability files significantly easier.

Files touched:

  • src/storage/v2/durability/serialization.hpp/cpp
  • src/storage/v2/durability/wal.cpp
  • src/storage/v2/durability/snapshot.cpp

Git commit description, explain the changes you made here


Leave above in PR description, copy the below into a comment


Tracking

  • [Link to Epic/Issue]

Standard development

CI Testing Labels

  • Select the appropriate CI test labels (CI -build=build-name -test=test-suite)

Documentation checklist

  • Add the documentation label
  • Add the bug / feature label
  • Add the milestone for which this feature is intended
    • If not known, set for a later milestone
  • Write a release note, including added/changed clauses
    • What has changed? What does it mean for a user? What should a user do with it? [#{{PR_number}}]({{link to the PR}})
  • [ Documentation PR link memgraph/documentation#XXXX ]
    • Is back linked to this development PR

…ity details

This commit makes all RecoveryFailure exceptions in the durability code
substantially more informative by adding:

1. Byte position (from decoder.GetPosition()) to generic decode errors.
   - Infrastructure: BaseDecoder now exposes GetPosition/GetSize/SetPosition.

2. Actual entity identifiers (gids, labels, edge types, vertex gids) to
   wal.cpp LoadWal recovery logic.

3. Byte positions and gids to snapshot.cpp errors across all load paths.

Previously most errors were bare strings like 'Invalid WAL data!' or
'Invalid edge!'. They now include actionable context that makes
debugging corrupted durability files significantly easier.

Files touched:
- src/storage/v2/durability/serialization.hpp/cpp
- src/storage/v2/durability/wal.cpp
- src/storage/v2/durability/snapshot.cpp
@andrejtonev andrejtonev self-assigned this May 15, 2026
@sonarqubecloud
Copy link
Copy Markdown

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