-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix build on Plan 9 #1451
Fix build on Plan 9 #1451
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
I've added |
Co-authored-by: Ibrahim Jarif <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> (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 <[email protected]> (cherry picked from commit 07fa3eb) Co-authored-by: Fazlul Shahriar <[email protected]>
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 <[email protected]>
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 <[email protected]> (cherry picked from commit 07fa3eb) Co-authored-by: Fazlul Shahriar <[email protected]>
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 <[email protected]> (cherry picked from commit 07fa3eb) Co-authored-by: Fazlul Shahriar <[email protected]> Co-authored-by: Fazlul Shahriar <[email protected]>
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 <[email protected]> (cherry picked from commit 07fa3eb) Co-authored-by: Fazlul Shahriar <[email protected]>
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![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)