Conversation
Plan 9 doesn't have mmap, so we just return an error. File locking is implemented using the exclusive mode bit. From http://man.cat-v.org/plan_9/5/open: If the file is marked for exclusive use (see stat(5)), only one client can have the file open at any time. That is, after such a file has been opened, further opens will fail until fid has been clunked. Initial attempt at implementing directory locking using this method was not successful because badger seems to be opening the directory multiple times (at least while running the test suite). As a workaround, we lock the pid lock file instead of the directory itself, same as the windows implementation.
jarifibrahim
left a comment
There was a problem hiding this comment.
This is awesome work @fhs 🎉. Thank you for fixing this. I have some comments.
I'm wondering how do we test this PR. Can you also add a GOOS=plan9 build to travis CI?
Co-authored-by: Ibrahim Jarif <jarifibrahim@gmail.com>
|
I've added |
Co-authored-by: Ibrahim Jarif <jarifibrahim@gmail.com>
jarifibrahim
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the PR @fhs 🎉 . I made one small line length change on this PR.
I'll merge this PR once CI finishes.
|
When can I expect this to be included in a release? I need this in a v1.6.x release to get ipfs working, but I can also wait for v1.7.0. IPFS tracking issue for Plan 9 support: ipfs/kubo#7575 |
|
We will be doing a badger 1.x release this week. This patch would be in that release. @NamanJain8 This needs to go in 1.x release. |
Plan 9 doesn't have mmap, so we just return an error. File locking is implemented using the exclusive mode bit. From http://man.cat-v.org/plan_9/5/open: If the file is marked for exclusive use (see stat(5)), only one client can have the file open at any time. That is, after such a file has been opened, further opens will fail until fid has been clunked. Initial attempt at implementing directory locking using this method was not successful because badger seems to be opening the directory multiple times (at least while running the test suite). As a workaround, we lock the pid lock file instead of the directory itself, same as the windows implementation. Co-authored-by: Ibrahim Jarif <ibrahim@dgraph.io> (cherry picked from commit 07fa3eb)
Plan 9 doesn't have mmap, so we just return an error. File locking is implemented using the exclusive mode bit. From http://man.cat-v.org/plan_9/5/open: If the file is marked for exclusive use (see stat(5)), only one client can have the file open at any time. That is, after such a file has been opened, further opens will fail until fid has been clunked. Initial attempt at implementing directory locking using this method was not successful because badger seems to be opening the directory multiple times (at least while running the test suite). As a workaround, we lock the pid lock file instead of the directory itself, same as the windows implementation. Co-authored-by: Ibrahim Jarif <ibrahim@dgraph.io> (cherry picked from commit 07fa3eb) Co-authored-by: Fazlul Shahriar <fshahriar@gmail.com>
Plan 9 doesn't have mmap, so we just return an error. File locking is implemented using the exclusive mode bit. From http://man.cat-v.org/plan_9/5/open: If the file is marked for exclusive use (see stat(5)), only one client can have the file open at any time. That is, after such a file has been opened, further opens will fail until fid has been clunked. Initial attempt at implementing directory locking using this method was not successful because badger seems to be opening the directory multiple times (at least while running the test suite). As a workaround, we lock the pid lock file instead of the directory itself, same as the windows implementation. Co-authored-by: Ibrahim Jarif <ibrahim@dgraph.io>
|
Looks like this was never backported to badger v2. Could we make that happen? Building against |
Plan 9 doesn't have mmap, so we just return an error. File locking is implemented using the exclusive mode bit. From http://man.cat-v.org/plan_9/5/open: If the file is marked for exclusive use (see stat(5)), only one client can have the file open at any time. That is, after such a file has been opened, further opens will fail until fid has been clunked. Initial attempt at implementing directory locking using this method was not successful because badger seems to be opening the directory multiple times (at least while running the test suite). As a workaround, we lock the pid lock file instead of the directory itself, same as the windows implementation. Co-authored-by: Ibrahim Jarif <ibrahim@dgraph.io> (cherry picked from commit 07fa3eb) Co-authored-by: Fazlul Shahriar <fshahriar@gmail.com>
Plan 9 doesn't have mmap, so we just return an error. File locking is implemented using the exclusive mode bit. From http://man.cat-v.org/plan_9/5/open: If the file is marked for exclusive use (see stat(5)), only one client can have the file open at any time. That is, after such a file has been opened, further opens will fail until fid has been clunked. Initial attempt at implementing directory locking using this method was not successful because badger seems to be opening the directory multiple times (at least while running the test suite). As a workaround, we lock the pid lock file instead of the directory itself, same as the windows implementation. Co-authored-by: Ibrahim Jarif <ibrahim@dgraph.io> (cherry picked from commit 07fa3eb) Co-authored-by: Fazlul Shahriar <fshahriar@gmail.com> Co-authored-by: Fazlul Shahriar <fshahriar@gmail.com>
Plan 9 doesn't have mmap, so we just return an error. File locking is implemented using the exclusive mode bit. From http://man.cat-v.org/plan_9/5/open: If the file is marked for exclusive use (see stat(5)), only one client can have the file open at any time. That is, after such a file has been opened, further opens will fail until fid has been clunked. Initial attempt at implementing directory locking using this method was not successful because badger seems to be opening the directory multiple times (at least while running the test suite). As a workaround, we lock the pid lock file instead of the directory itself, same as the windows implementation. Co-authored-by: Ibrahim Jarif <ibrahim@dgraph.io> (cherry picked from commit 07fa3eb) Co-authored-by: Fazlul Shahriar <fshahriar@gmail.com>
Plan 9 doesn't have mmap, so we just return an error.
File locking is implemented using the exclusive mode bit.
From http://man.cat-v.org/plan_9/5/open:
Initial attempt at implementing directory locking using this method was
not successful because badger seems to be opening the directory multiple
times (at least while running the test suite). As a workaround, we lock
the pid lock file instead of the directory itself, same as the windows
implementation.
This change is