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

when /tmp is under tmpfs (in arch linux) opts.DB.IngestExternalFiles(externalFiles) will block forever #217

Open
woodgear opened this issue Aug 12, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@woodgear
Copy link
Contributor

snap

directio open file issue

change dir in cluster.go could fix this.

@Connor1996
Copy link
Collaborator

Thanks for your feedback. Do you have any suggestion to fix it?

@woodgear
Copy link
Contributor Author

use another dir to avoid tmpfs. for example current_dir/tmp

@rapiz1
Copy link
Contributor

rapiz1 commented Jan 26, 2021

I think this is a critical issue since most Linux distros mount /tmp on tmpfs (systemd feature).
And it took me 2 hours to locate the problem which was in the test, not in my code. It was really an unpleasant experience. At least there should be a caveat in the doc.

@Connor1996 Connor1996 added the bug Something isn't working label Jan 27, 2021
@Connor1996
Copy link
Collaborator

@rapiz1 Would you mind sending a fix, change the dir or add a caveat warning in the doc.

@wangnengjie
Copy link
Contributor

wangnengjie commented Jan 31, 2021

func (c *Cluster) Start() {
	......
+	_ = os.RemoveAll("./tmp")
+	_ = os.Mkdir("./tmp", 0755|os.ModeDir)
	for storeID := uint64(1); storeID <= uint64(c.count); storeID++ {
-		dbPath, err := ioutil.TempDir("", "test-raftstore")
+		dbPath, err := ioutil.TempDir("./tmp", "test-raftstore")
	......

maybe somewhat like this? Or add mkdir&rm in Makefile.
RemoveAll can be ignored. But when the test failed, the dir will be huge as clients do not call MustDelete.

@rapiz1
Copy link
Contributor

rapiz1 commented Feb 1, 2021

What's the point of using directio here? I think performance and consistency across crash is not an issue since it's just a tutorial project. So we can just simply replace all directio.OpenFile with os.OpenFile and just drop directio out of badger. It works on Arch and it should work everywhere. @Connor1996

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants