Skip to content

Fix false positives of "missing entries for record X" error during index validation when a deleted record version is committed and has a backversion#7694

Merged
ilya071294 merged 1 commit intoFirebirdSQL:masterfrom
red-soft-ru:fb_5_0_index_validation_fix
Aug 7, 2023
Merged

Conversation

@ilya071294
Copy link
Copy Markdown
Contributor

The existence of an index entry is not required for such version chain because it is all garbage since a transaction is committed. To reproduce the false positive, the server should be stopped just after the chain is garbage-collected and an index page is written to disk.

…dex validation when a deleted record version is committed and has a backversion

The existence of an index entry is not required for such version chain because it is all garbage since a transaction is committed. To reproduce the false positive, the server should be stopped just after the chain is garbage-collected and an index page is written to disk.
Comment thread src/jrd/validation.cpp
if (header->rhd_b_page && !deleted_flag)
RBM_SET(pool, &vdr_rel_records, number.getValue());
else if ((header->rhd_flags & rhd_deleted) == 0)
else if (header->rhd_b_page || !deleted_flag)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both ifs contain condition header->rhd_b_page. Cannot they be replaced with single if?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I tried it before and it led to unnecessary code duplication.

@ilya071294 ilya071294 merged commit ad4addd into FirebirdSQL:master Aug 7, 2023
@ilya071294 ilya071294 self-assigned this Aug 7, 2023
@ilya071294 ilya071294 deleted the fb_5_0_index_validation_fix branch August 7, 2023 07:56
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