-
Notifications
You must be signed in to change notification settings - Fork 411
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
PageStorage: Fix empty page cause TiFlash failed to start #9283
Conversation
return (offset < start) || (offset > end) || (offset + size - 1 > end); | ||
return (offset < start) | ||
|| (offset > end) | ||
// check whether it can be changed to `(offset + size > end)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will test it later, now just keep the same behavior
f024432
to
4708770
Compare
4708770
to
594bf27
Compare
/retest |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CalvinNeo, JinheLin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #9282
Problem Summary:
By dumping the entries from PageStorage WAL, we can locate that two entries cause this issue:
The first entry is a page with data.size == 0, placed at blob_id=551, offset=0x15376. And later another page is placed at blob_id=551, offset=0x15373 with data.size == 15.
The first page split the free block into smaller pieces free blocks.
The second page will cover the place of the first page. And our code can not handle this situation with "empty page data".
What is changed and how it works?
STDMapSpaceMap::markUsedImpl
accept a block oflength == 0
, it will directly return true instead of splitting the free block into smaller pieces.BlobStats::BlobStat::getPosFromStat
andSTDMapSpaceMap::searchInsertOffset
accepts a block oflength == 0
, it will returninsert_offset == 0
, which we can "store the empty pages" at the front of the BlobFile for newly created empty pages.BlobStore::read(...)
, we ensure that reading empty pages won't cause NPE or other unexpected exceptionsCheck List
Tests
Side effects
Documentation
Release note