Skip to content

Recover from PrevHashMismatch errors in recovery-range scanning.#175

Closed
nuttycom wants to merge 1 commit intomainfrom
fix/recover_scan_truncation
Closed

Recover from PrevHashMismatch errors in recovery-range scanning.#175
nuttycom wants to merge 1 commit intomainfrom
fix/recover_scan_truncation

Conversation

@nuttycom
Copy link
Contributor

No description provided.

Ok(_) => {}
Err(chain::error::Error::Scan(ScanError::PrevHashMismatch { at_height })) => {
db_data
.truncate_to_height(at_height - 10)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break the internal state of the steady_state task. And given that it's supposed to be the steady_state task that handles reorgs, that suggests there is a different problem causing this bug. My current suspicion is unclean shutdown (I've seen this in a few different ways, such as #136).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, the error was at the chain tip as of when the node shut down; then, it was several hours later when I went to start the node back up. But I now note that the same error is possible in the steady state scanning, and it isn't handled there - previously I had only added the handling for this case in the initialize method.

Do we really need all three of these? Can the initialize case not be handled by the steady state scanning?

@nuttycom nuttycom marked this pull request as draft July 15, 2025 21:35
@nuttycom nuttycom closed this Sep 6, 2025
@nuttycom nuttycom deleted the fix/recover_scan_truncation branch September 6, 2025 04:37
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.

2 participants