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

deleted_records_only #6

Open
cothee opened this issue May 24, 2018 · 3 comments
Open

deleted_records_only #6

cothee opened this issue May 24, 2018 · 3 comments
Labels

Comments

@cothee
Copy link

cothee commented May 24, 2018

when looking for deleted records only, why we consider all pages are not valid?(in c_parser.c, line 512)

@akuzminsky
Copy link
Member

It's by design. "Valid" maybe is not the best name, but it actually means that you can travel from the infimum to supremum record following "next record pointers". InnoDB will skip any deleted records because InnoDB updates "next record pointer" to remove a deleted record from a chain of records.
So, to find any deleted records c_parser doesn't check if a page is valid or not, it considers the page invalid and scans the page byte by byte.

@cothee
Copy link
Author

cothee commented May 24, 2018

In this way, when finding deleted records, we should scan all of the records that after supremum in physical position. so the start offset should be no less than (supremum + 8, ie. 112 + 8). But in the c_parser, the start offset is 100 + REC_N_NEW_EXTRA_BYTES(which is 5 in compact format). I just can not figure why 105, and I think maybe this is a bug when finding deleted records. BTW, why don't you scan deleted records start by PAGE_FREE pointer? That will just find the deleted records.

@akuzminsky
Copy link
Member

I doesn't really matter where to start, at 105 or 120. The supremum record won't match anyway.
The tool used to scan from the byte zero, but there were some crashes, so I moved the starting point a bit. So, we can call it historical reasons.

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

No branches or pull requests

2 participants