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

unistore: check directio support before unistore boot #39238

Closed

Conversation

YangKeao
Copy link
Member

Signed-off-by: YangKeao yangkeao@chunibyo.icu

What problem does this PR solve?

Issue Number: close #39237

Problem Summary:

Unistore cannot work on a path, which doesn't support directio. TiDB should refuse to work on a tmpfs (or other fs which doesn't support directio).

What is changed and how it works?

Add a check to verify whether the target path supports directio before starting the unistore

Check List

Tests

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

Start the tidb with unistore on a machine whose /tmp is a tmpfs, it will give an error and stop:

[2022/11/18 15:50:28.625 +08:00] [FATAL] [terror.go:300] ["unexpected error"] [error="open /tmp/tidb/direct-io-test: invalid argument"] [stack="github.com/pingcap/tidb/parser/terror.MustNil\n\t/home/yangkeao/Project/github.com/YangKeao/tidb/parser/terror/terror.go:300\nmain.createStoreAndDomain\n\t/home/yangkeao/Project/github.com/YangKeao/tidb/tidb-server/main.go:306\nmain.main\n\t/home/yangkeao/Project/github.com/YangKeao/tidb/tidb-server/main.go:211\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:250"] [stack="github.com/pingcap/tidb/parser/terror.MustNil\n\t/home/yangkeao/Project/github.com/YangKeao/tidb/parser/terror/terror.go:300\nmain.createStoreAndDomain\n\t/home/yangkeao/Project/github.com/YangKeao/tidb/tidb-server/main.go:306\nmain.main\n\t/home/yangkeao/Project/github.com/YangKeao/tidb/tidb-server/main.go:211\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:250"]

Release note

Fix the issue that the unistore will start but deadlock on a file system without directio support by throwing errors.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 18, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Defined2014
  • xhebox

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 18, 2022
@YangKeao YangKeao changed the title unistore: check directio before unistore boot unistore: check directio support before unistore boot Nov 18, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 18, 2022
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
@YangKeao YangKeao force-pushed the check-directio-before-unistore-boot branch from bbe982f to a9092a2 Compare November 18, 2022 08:01
Copy link
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

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

@YangKeao need to complete the issue triage

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 24, 2022
@YangKeao
Copy link
Member Author

YangKeao commented Dec 8, 2022

I'll update the implementation of badger to work around the directio, so close this pull request.

@YangKeao YangKeao closed this Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unistore will dead lock in a tmpfs
5 participants