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

PageStorage: Fix TiFlash may fail to restart after FAP is enabled #9319

Merged

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Aug 13, 2024

What problem does this PR solve?

Issue Number: close #9307

Problem Summary:

A RemotePage

  1. Ingested into a Segment by FAP
  2. The Segment get logical split, two RefPage to the RemotePage is created
  3. The Ingested RemotePage is deleted
  4. The split left and right segment get logical split again
  5. A read to the segment is performed, and the original RemotePage get updated

The sequence that PageStorage see is

--- The page_id '0x78000001746C0000000000000060.3359'
---  created @ ver=676072, epoch=0
---  ref by .3439 @ ver=685132
---  ref by .3441 @ ver=685134
---  deleted @ ver=685265
---  ref by .3493 @ ver=693249
---  ref by .3495 @ ver=693251
---  ref by .3497 @ ver=693272
---  ref by .3499 @ ver=693274
--- Then '.3497' get read, UPDATE_DATA_FROM_REMOTE @ ver=729397

What is changed and how it works?

PageStorage: Fix TiFlash may fail to restart after FAP is enabled

PageDirectory::updateLocalCacheForRemotePages and PageDirectoryFactory::applyRecord will call updateLocalCacheForRemotePage with ignore_delete=true when trying to update local cache of a RefPage (id_to_resolve != r.page_id)

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 13, 2024
@JaySon-Huang JaySon-Huang force-pushed the fix_remote_page_with_logical_split branch from 063f9b0 to 3058b77 Compare August 14, 2024 15:32
@JaySon-Huang JaySon-Huang changed the title [WIP] PageStorage: Fix TiFlash may fail to restart after FAP is enabled PageStorage: Fix TiFlash may fail to restart after FAP is enabled Aug 14, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 14, 2024
Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 15, 2024
Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

ti-chi-bot bot commented Aug 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CalvinNeo, Lloyd-Pottiger

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:
  • OWNERS [CalvinNeo,Lloyd-Pottiger]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 15, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 15, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-15 02:07:36.893851841 +0000 UTC m=+406541.597321485: ☑️ agreed by Lloyd-Pottiger.
  • 2024-08-15 02:29:49.52577253 +0000 UTC m=+407874.229242174: ☑️ agreed by CalvinNeo.

@JaySon-Huang
Copy link
Contributor Author

FAILED TESTS (2/2850):
    6710 ms: /tiflash/gtests_dbms ReadIndexTest.workers
  231116 ms: /tiflash/gtests_dbms ComputeServerRunner.multipleQuery
INTERRUPTED TESTS (1/2850):
Interrupted: /tiflash/gtests_dbms RegionKVStoreTestFAP.TableNotFound

after running for 45min

@JaySon-Huang
Copy link
Contributor Author

/test pull-unit-test

@ti-chi-bot ti-chi-bot bot merged commit 7d5f4ce into pingcap:master Aug 15, 2024
5 checks passed
@JaySon-Huang JaySon-Huang deleted the fix_remote_page_with_logical_split branch August 15, 2024 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiFlash may fail to restart after FAP is enabled
3 participants