Skip to content

Add time and thread_id for snapshot to check stale snapshots (#2229)#2238

Closed
ti-srebot wants to merge 8 commits intopingcap:release-4.0from
ti-srebot:release-4.0-8f8b729e5c95
Closed

Add time and thread_id for snapshot to check stale snapshots (#2229)#2238
ti-srebot wants to merge 8 commits intopingcap:release-4.0from
ti-srebot:release-4.0-8f8b729e5c95

Conversation

@ti-srebot
Copy link
Collaborator

@ti-srebot ti-srebot commented Jun 23, 2021

cherry-pick #2229 to release-4.0
You can switch your code base to this Pull Request by using git-extras:

# In tics repo:
git pr https://github.com/pingcap/tics/pull/2238

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/tics.git pr/2238:release-4.0-8f8b729e5c95

What problem does this PR solve?

Issue Number: related to #2199

Problem Summary: Suspicious that some tasks hold snapshot for a long time, prevent PageStorage from GCing old PageFiles

What is changed and how it works?

Add create_time and thread_id when creating snapshots. After PageStorage::gc, log the oldest snapshot living time and its thread_id.
We can trace to thread_id to know whether the snapshot is created for reading / background task.
When the create_time and thread_id and the period of logging files, we can know exactly which task holds the snapshot for a long time.

Related changes

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    • Deploy a TiFlash with these changes to check the logging

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM

Release note

  • No release note

@ti-srebot ti-srebot added CHERRY-PICK cherry pick status/LGT1 Indicates that a PR has LGTM 1. labels Jun 23, 2021
@ti-srebot ti-srebot requested a review from flowbehappy June 23, 2021 02:56
@ti-srebot ti-srebot added this to the v4.0.14 milestone Jun 23, 2021
@JaySon-Huang
Copy link
Contributor

merge the changes from #2241

JaySon-Huang and others added 6 commits June 23, 2021 16:58
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@jiangyuzhao jiangyuzhao force-pushed the release-4.0-8f8b729e5c95 branch from b789c90 to c0885c6 Compare June 23, 2021 09:00
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@JaySon-Huang
Copy link
Contributor

Not plan to fix this in release-4.0, closing it.

@JaySon-Huang JaySon-Huang deleted the release-4.0-8f8b729e5c95 branch August 4, 2021 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CHERRY-PICK cherry pick status/LGT1 Indicates that a PR has LGTM 1.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants