-
Notifications
You must be signed in to change notification settings - Fork 410
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) #9285
PageStorage: Fix empty page cause TiFlash failed to start (#9283) #9285
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
/run-all-tests |
/run-integration-test |
/run-all-tests |
/run-all-tests |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CalvinNeo, JaySon-Huang 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 |
[LGTM Timeline notifier]Timeline:
|
/run-unit-test |
This is an automated cherry-pick of #9283
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