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

repo fsck doesn't remove badger lockfile #4301

Closed
djdv opened this issue Oct 13, 2017 · 3 comments
Closed

repo fsck doesn't remove badger lockfile #4301

djdv opened this issue Oct 13, 2017 · 3 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws) topic/badger Topic badger topic/repo Topic repo

Comments

@djdv
Copy link
Contributor

djdv commented Oct 13, 2017

Version information:

go-ipfs version: 0.4.12-dev-e7acb96c6
Repo version: 6
System version: amd64/windows
Golang version: go1.9.1

Type:

Bug

Severity:

Medium

Description:

Running ipfs repo fsck reports that lockfiles were successfully removed but they're not.

ipfs repo fsck not clearing

@Stebalien Stebalien added kind/bug A bug in existing code (including security flaws) topic/repo Topic repo labels Oct 13, 2017
@kevina kevina assigned magik6k and unassigned kevina Nov 28, 2017
@kevina
Copy link
Contributor

kevina commented Nov 28, 2017

From ipfs-dev channel on irc:

<kevina> stebalien: if your around, why was I assigned to #4301?
<stebalien> kevina: I probably fat fingered something. I intended to assign that to Magik6k.

@schomatis
Copy link
Contributor

@djdv Thanks for reporting this. It's a Badger error currently being fixed (see dgraph-io/badger#424), in short, the Windows lock implementation needs to create the file, if LOCK already exists Badger (incorrectly) assumes another process is using the DB (and doesn't take into consideration the scenario where Badger unexpectedly stopped and didn't clean up the lock). In Unix Badger just (correctly) tries to acquire a lock over the LOCK file (not caring if it already exists or not, just that it's not being used by another process).

The ipfs repo fsck command clears the LOCK file from the datastore directory (which I'm not sure what it does), it's not in charge of cleaning Badger's internal lock (in the badgerds directory).

I'll keep an eye on the Badger fix.

@schomatis schomatis self-assigned this May 3, 2018
@schomatis schomatis added the topic/badger Topic badger label May 3, 2018
@Kubuxu
Copy link
Member

Kubuxu commented May 7, 2018

@schomatis the LOCK file in a datastore is to prevent multiple instances running over the same repo. The ipfs repo fsck removes the LOCK file from it because we had the same issue badger has currently. We didn't have proper locking on Windows and were using just a file to do it. Currently, we lock properly on Windows so ipfs repo fsck isn't really needed anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/badger Topic badger topic/repo Topic repo
Projects
None yet
Development

No branches or pull requests

6 participants