Skip to content

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

Merged
danielmai merged 1 commit intodgraph-io:release/v2.2007from
francislavoie:backport-plan9
Aug 24, 2021
Merged

Backport "Fix build on Plan 9" to Badger v2#1738
danielmai merged 1 commit intodgraph-io:release/v2.2007from
francislavoie:backport-plan9

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