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

Backport "Fix build on Plan 9" to Badger v2 #1738

Merged
merged 1 commit into from
Aug 24, 2021

Conversation

francislavoie
Copy link

@francislavoie francislavoie commented Aug 23, 2021

See #1451 (comment) for context.

The fixes for Plan 9 were merged to the v3 branch, but it would be useful to have on the v2 branch as well, so we can get a step closer to Caddy working on Plan 9 caddyserver/caddy#3615


This change is Reviewable

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>
@CLAassistant
Copy link

CLAassistant commented Aug 23, 2021

CLA assistant check
All committers have signed the CLA.

@francislavoie francislavoie changed the base branch from master to release/v2.2007 August 23, 2021 23:52
Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @francislavoie)

@francislavoie
Copy link
Author

francislavoie commented Aug 24, 2021

all discussions resolved (waiting on @francislavoie)

What's needed from me?

P.S. Please don't forget about #1736 as well!

@danielmai
Copy link
Contributor

Thanks for the PR @francislavoie. I'll merge this one.

@danielmai danielmai merged commit f0549ca into dgraph-io:release/v2.2007 Aug 24, 2021
@francislavoie francislavoie deleted the backport-plan9 branch August 24, 2021 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants