Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible BUGCHECK "cannot find tip page" during validation with -full or -mend option #7857

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ilya071294
Copy link
Contributor

If a primary record version has a transaction number which is greater than NT and seems corrupted, its state will be treated as tra_active to avoid an attempt to fetch a non-existing TIP page.

…full or -mend option

If a primary record version has a transaction number which is greater than NT and seems corrupted, its state will be treated as tra_active to avoid an attempt to fetch a non-existing TIP page.
Copy link
Member

@hvlad hvlad left a comment

Choose a reason for hiding this comment

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

I have no objection, just one question - what consequences you expect with such change, if it is Next on disk is wrong (less than actual value) ?
Perhaps such condition could be detected in walk_tip() ?

@ilya071294
Copy link
Contributor Author

if it is Next on disk is wrong (less than actual value)

The actual value - do you mean it as the number of the last non-active transaction on the TIP?

@hvlad
Copy link
Member

hvlad commented Nov 23, 2023

if it is Next on disk is wrong (less than actual value)

The actual value - do you mean it as the number of the last non-active transaction on the TIP?

Yes, exactly.

@ilya071294
Copy link
Contributor Author

Yes, exactly.

If such corruption is detected, is it possible to fix it safely? Which page can we trust more - the header or the TIP?

@hvlad
Copy link
Member

hvlad commented Nov 30, 2023

If such corruption is detected, is it possible to fix it safely? Which page can we trust more - the header or the TIP?

If Next points to the last TIP page and if TIP chain is valid, then both header and last TIP could be trusted in the same degree, IMHO.

@dyemanov
Copy link
Member

Do we expect any more commits inside this PR? Or can it be merged now?

…o state which number is greater than Next transaction. When -mend option is specified, fix it by advancing Next transaction.

2. Do not call TRA_extend_tip() when it's possible to reconstruct the TIP chain using tip_next from the previous page. Also TRA_extend_tip() call is only allowed when the sequence is not found at the end of the vector. It prevents the potential loss of TIPs because this function unconditionally allocates a new TIP and overwrites tip_next.
3. Check the count of elements in the vector before accessing them to avoid an assertion failure in getElement().
@ilya071294 ilya071294 requested a review from hvlad April 1, 2024 11:23
@ilya071294
Copy link
Contributor Author

Conflicts are solved. Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants