Summary:
Now that we have globFiles available via thrift on windows,
we can use it to implement eden prefetch on windows, rather than the
significantly slower `hg prefetch`.
Reviewed By: pkaush
Differential Revision: D20781187
fbshipit-source-id: f6cd37a2a504d07f03be2695a69a72ddf7a62593
Summary:
Add variants of the helpers that return by value rather
than by reference so that we can use those on Windows (which
doesn't embed a `timespec` in a `struct stat`).
Reviewed By: simpkins
Differential Revision: D20562242
fbshipit-source-id: e4769fccb40229765bbf99d0967708cc864db6c3
Summary:
This enables globFiles for Windows, with some
minor tweaks around dtype to enable the build and make
the results consistent between watchman and eden.
Reviewed By: chadaustin
Differential Revision: D20536715
fbshipit-source-id: b1c8184dc664910e4d052a21b4cd993ddfaadf25
Summary:
This is ostensibly removing and ifndef to enable watchman
to successfully query the journal.
However, for this to work we need to teach the mountPoints list about
normalizing file names.
We avoid using realpath on posix systems because we absolutely cannot afford to
make VFS calls back to ourselves. I don't know if the same applies on Windows.
If not then perhaps the right thing to do here is to use something like
GetFinalPathNameW to canonicalize the paths.
For now, this does the dumb thing and lowercases and converts slashes.
With this change, watchman is able to subscribe to eden and query
journal information.
However, since most queries get translated to glob requests it
still isn't useful; need to enable globFiles in a follow up diff.
Reviewed By: pkaush
Differential Revision: D20516737
fbshipit-source-id: 2053d7b565a40f6ae9cc738386e37d737772e91e
Summary: This diff ports DiffTest on Windows and enables them for the CMake builds.
Reviewed By: simpkins
Differential Revision: D20480869
fbshipit-source-id: 77eda5ef53e4cd19552f0da52de4ff53d9807cc3
Summary: This diff adds readdir tests for Windows and enables InodeBaseTest and TreeInodeTest for CMake build.
Reviewed By: simpkins
Differential Revision: D20480866
fbshipit-source-id: 44fb33448c2e6cdb3ecce08136bf8b9e1d5c398a
Summary: This diff make the InodeMapTest work on Windows and enables this test on all the platforms for CMake build.
Reviewed By: wez
Differential Revision: D20480865
fbshipit-source-id: 8f13f88bb3655475c635c889851e39672ce5b9c7
Summary:
Enable building fake_edenfs.cpp and TakeoverTool.cpp in the CMake build.
This includes a few changes to get `fake_edenfs.cpp` closer to building on
Windows, but at the moment it still does not fully build since the
`StartupLogger` is currently not compiled on Windows.
TakeoverTool.cpp is specific to the graceful restart tests, and doesn't make
sense to ever build on Windows.
Reviewed By: wez
Differential Revision: D21214614
fbshipit-source-id: a7a8306ea3f69579fa02bd3753a66d3095ea004a
Summary: This diff enables running source control update and rebase operations on Eden Windows clones.
Reviewed By: wez
Differential Revision: D20480873
fbshipit-source-id: 9e7cd6acdd9aedc87ddfe126718f48509d1d7c4f
Summary:
This diff updates the EdenDispatcher to fetch/update the FS info in EdenMount which is backed by InodeTree. This helps to store the FS state in the Inode structure, which are used for source control status and update operations.
Also added a custom formatter definition for RelativePathPiece to make it easy to log relative paths.
Reviewed By: simpkins
Differential Revision: D20480861
fbshipit-source-id: b4bf1da3eeebeaee46a4a187eea9193302182068
Summary: On Windows we are seeing frequent hang issues while using telemetry hg binary. Switching to using the hg.real for all the platforms.
Reviewed By: simpkins
Differential Revision: D20480875
fbshipit-source-id: 82892da7f8d46f2413442c37251243400180f9db
Summary: Eden Windows now shares the common EdenMount code. We can remove the unused version of EdenMount.
Reviewed By: simpkins
Differential Revision: D20993231
fbshipit-source-id: 943ee540c5f2aa30827afb73658cb0250143e4af
Summary: Now we are building the merged EdenMount on Windows, so we can also start using the new TestMount code.
Reviewed By: simpkins
Differential Revision: D20966556
fbshipit-source-id: a726b13250d6c29872349e1a2f562c719420f3f1
Summary:
This diff enabled building the Inodes code on the Windows platform. With this we also swtich to using the new merged version of EdenMount.
From this diff onwards Eden Windows works with Inodes.
Reviewed By: simpkins
Differential Revision: D20955997
fbshipit-source-id: 9b9d8bf56c352c98a3018e5bb389e35489ebd6fb
Summary: We have merged the Windows version of test mount to the POSIX, which now work across platform. We can remove the older version now.
Reviewed By: simpkins
Differential Revision: D20955565
fbshipit-source-id: c68eef961d27e822e6408eba06876a4034e8f3d2
Summary: These tests were designed to work with registry based implementation to store the status information. We need to remove them before we could swtich to the new Inode based merged EdenMount.
Reviewed By: simpkins
Differential Revision: D20951974
fbshipit-source-id: fa9438e157ddfb4a66ba2b1de11c1b634481d3b3
Summary: Close the Pipe handles that are inherited in the child and are not needed in the parent process. This will also make sure the pipe is closed when the child process ends.
Reviewed By: simpkins
Differential Revision: D20923588
fbshipit-source-id: aa58e99148d2f5c3bf666a3237266eac725be563
Summary: These API will handle the file system requests for each mount.
Reviewed By: simpkins
Differential Revision: D20480868
fbshipit-source-id: 84149af4449d258149fce97bb227d45d8d3d0e3a
Summary: Adds a new version of readdir which populates FileMetadata. This version of readdir is used to return the result to Projected FS.
Reviewed By: wez
Differential Revision: D20480876
fbshipit-source-id: dae99753225bc3124e734e3926e777fb629b2a64
Summary:
The new merged EdenMount uses the sqlite overlay to track the status. Removing the calls to CurrentStatus from EdenMount.
This change is required here before we can switch to the merged EdenMount. Later in this stack we will add calls to the Inode APIs to report the FS changes.
Reviewed By: simpkins
Differential Revision: D20895074
fbshipit-source-id: 5e04684203f5735ff9068d3609b256991d1569f4
Summary: This diff is merging the Windows version of MountTest with the POSIX version. The merged MountTest is build and tested later in this stack with the Merged EdenMount.
Reviewed By: simpkins
Differential Revision: D20480864
fbshipit-source-id: 65e9402f1b03c81166835a6a605053a1bf011ddc
Summary: The diff merge the Windows version of EdenMount into POSIX version. We don't start using the new all platform version of EdenMount in this diff. This switch needs few more changes and is done later in this diff stack.
Reviewed By: simpkins
Differential Revision: D20480878
fbshipit-source-id: 42bfaee8769beb7a2ac45cfcff5dda2a52a7dcb0
Summary: This diff implements DirList for Windows and use it for readdir implemetation. On Windows readdir will return all the entries in one single call.
Reviewed By: simpkins
Differential Revision: D20480871
fbshipit-source-id: 15abb337c55c5016debeb0680a1a3a7063b341c3
Summary:
This diff introduces a sqlite based overlay, which stores the directory inode and its entries in the sqlite database. This is similar to FsOverlay but doesn't support all the functionality. Sqlite overlay in this diff is only designed to handles the requirement for Eden on Windows.
We did not build sqlite overlay as a virtual class because as of this diff the interface and functionality of this is different from fsOverlay.
Reviewed By: simpkins
Differential Revision: D20480870
fbshipit-source-id: c87cb2ffd11c6c0c7a10bc8dfaf6164e0e442b2b
Summary:
Tl;DR Reduces costs of fuse request mertics by reducing lock contention.
D20922194 adds tracking for FUSE request metrics, this makes tracking those
metrics more efficient. Since every user request goes through the FUSE channel,
we want to reduce the cost of these metrics as much as possible (originally
mentioned in a comment D20922194).
The synchronization used to track the metrics is costly especially
when the lock is contended.
To reduce the cost, each FuseChannel will have a thread local copy of metrics.
Each will still be synchronized to allow for reading the metrics and for
Requests moved to other threads that will need to access the metrics. However,
the lock should be contended less often since only requests from a single fuse
channel thread will access it.
Reviewed By: chadaustin
Differential Revision: D21043792
fbshipit-source-id: ce58a0cbce334095976233bfac7578d39c81bb55
Summary:
This adds a new `EdenTestCaseBase` class to serve as the base class across a
number of our integration tests and some of our CLI tests.
The main goal of this is to allow eliminating many of the annoying `*Mixin`
classes used in a lot of our integration tests. These mixin classes are
annoying since they result in complicated multiple inheritance, and it can be
tricky to ensure that the method resolution order behaves the way you want.
The systemd tests in particular use a lot of mixins, which gets complicated.
These mixin classes are also awkward from a Python typing perspective, and the
systemd tests end up resorting to just declaring different APIs in several
places when `typing.TYPE_CHECKING` is True.
The fact that `EdenTestCaseBase` has a `contextlib.ExitStack` member variable
should make it easier for us to eliminate these mixins moving forward: rather
than using mixins that use inheritance and assume a `self.cleanUp()` method
exists, we can transition this code to standalone functions or context
managers, and they can take the `ExitStack` variable as an argument if
necessary.
Reviewed By: wez
Differential Revision: D21084097
fbshipit-source-id: 77ee457b7debe6f584f630e3e30f79fe634a2026
Summary:
Update most locations in edenfsctl to report the version number that was built
into the edenfsctl binary at build time, rather than querying the RPM database
for the installed RPM version. The RPM behavior only works on to RedHat-based
Linux systems, and the currently running process doesn't necessarily have to
have come from the RPM.
The one place where we do still attempt to print the RPM version is in the
`edenfsctl rage` report, when running on Linux.
Reviewed By: wez
Differential Revision: D21000168
fbshipit-source-id: 0fb747e71b6950d74f22c458efa0dfcbd45270bd
Summary:
This updates the top-level CMakeLists.txt file to compute package version
information, and expose this to C++ code in `eden-config.h`, and to Python
code in a new `eden/config.py` module.
Previously we exposed an `EDEN_VERSION` macro for the C++ code in
`eden-config.h`, but this was not initialized or used anywhere. Now the
top-level CMakeLists.txt file computes appropriate version information and
exposes the package name, version, release, commit ID, and build time in these
configuration files.
The version selection logic in CMakeLists.txt based largely on the code that
wez wrote for watchman in D20636833.
Reviewed By: wez
Differential Revision: D21000164
fbshipit-source-id: db1a1035f1eefec058bbad558d35e113005e454e
Summary:
This exposes metrics for the live FUSE requests (the duration
of the longest outstanding request and the number of outstanding
requests).
Because FUSE is the interface through which the user mostly interacts
with the file system they provide good metrics to judge if the perfomance
of eden is normal, or there may be an issue.
Exposing these counters this way will send them to ods, so it will not only
allow for debuging current issues, but can be used to look back at previous
problems. This data could also be used for alerting or more proactive
remediation.
Metrics are exposed per checkout to allow seeing which checkout was
having issues. This data will aggregated in `eden top` to be used as
an overall health indicator, but should more information be needed it
will be logged in ods.
Reviewed By: chadaustin
Differential Revision: D20922194
fbshipit-source-id: 16208883417acb77b62bf712cfdd9068c5420303
Summary:
Build and run the fuse privhelper unit tests, as well as the `drop_privs`
helper program used by some of the integration tests.
Reviewed By: wez
Differential Revision: D21004425
fbshipit-source-id: 650e0729909f4753095e19fba4f01c02d516713b
Summary:
The listIgnored argument is not used anywhere, so this won't fix anything,
but this caught my eye while looking at the code.
Reviewed By: fanzeyi
Differential Revision: D21147432
fbshipit-source-id: e696d926fe0999da14c8c5748a0951b229c20efb
Summary: These appear to be passing on my laptop, let's enable them.
Reviewed By: fanzeyi
Differential Revision: D21145712
fbshipit-source-id: cbe6578c2206192ec2fd8c68aba07d8ea860682b
Summary:
On Windows, paths components are usually separated by '\', and since the
repository path is stored in a toml file, whatever character is after a '\',
will be escaped. In my case, this is followed by U (for C:\Users), and thus
toml expects the next characters to be an escaped unicode. That's obviously
not the case and thus EdenFS fails to parse the config, preventing me from
cloning fbsource.
Since Windows is perfectly fine with '/' as path separator, let's just
replace '\' with '/'.
The underlying bug appears to be in the toml Python code: https://github.com/uiri/toml/issues/280
Manually trying some random path is pretty conclusive:
(Pdb) toml.dumps({'foo': 'c:\\Users\\wez'})
'foo = "c:\\\\Users\\\\wez"\n'
(Pdb) toml.dumps({'foo': 'c:\\Users\\xavier'})
'foo = "c:\\Users\\xavier"\n'
Reviewed By: chadaustin
Differential Revision: D21143545
fbshipit-source-id: 448471da12c253dd37680f6a28251a1e69850920
Summary:
The `eden_fuse_privhelper` library depends on CoreFoundation and IOKit.
Previously this dependency was specified for the `eden_service` library, which
doesn't use these frameworks directly, only indirectly through the
`eden_fuse_privhelper` library.
The fact that `eden_fuse_privhelper` was missing this dependency causes
problems when trying to build unit tests and tools that depend on
`eden_fuse_privhelper` without using the `eden_service` library.
Reviewed By: genevievehelsel
Differential Revision: D21057925
fbshipit-source-id: b846ebde0de158b70be462067c4412a655ad8036
Summary:
As a top layer of reliability in graceful restart, we'd like the CLI to enforce that something has started after a graceful restart call. There are a few things that can happen
1) The restart short circuts before attempting to shutdown (version mismatch etc). The old process will continue (`success == False`)
2) The restart is successful, the new process will continue (`success == True`)
3) The restart is not successful (failed ping), the old process will recover (`success ==
False`)
(note here that the `success` field is the return code of the `StartupLogger` process, not the edenfs process itself).
In case any of these fail, we'd like a final line of defence with the CLI.
First, in the case of a successful start from the `StartupLogger` report, we consider this successful and exit. If we do not have a successful (`success == False`) graceful restart, we will wait for the new process to recover (since the old process will go from `ALIVE` to `STOPPED` to `ALIVE`). I do not expect recovery to take long since we are only remounting, not waiting on RocksDB. Here though, we give a fairly long timeout (1hr) to ensure we're not stuck on an in process thrift call, since we would not like to force kill the process if we're writing to the overlay.
If we time out waiting, we will just kick off a force restart and assume the old process is stuck.
Reviewed By: simpkins
Differential Revision: D20673460
fbshipit-source-id: 215e06fa8aa76dbe5dae6602f82ce5f05968e538
Summary:
This restructures the `ThriftServer server_` stopping logic in the graceful restart case. Instead of stopping the server, we stop listening then explicitly stop the server. This refactor should exhibit the same behavior as today since we block on `stopListening()`, but this will allow for simpler refactoring of thrift call queueing logic in the future (by removing the `stopListening()` call and replacing it with a `startQueueingAndWaitForOutstandingCallsToFinish()` type of call).
In terms of layout, this consolidates all the stopping code into one function `startTakeoverShutdown()`. This function now returns the `TakeoverData` itself instead returning a future that is fulfilled after stopping the Thrift server. The TakeoverServer still communicates via `takeoverComplete`, but now that future is stored during `startTakeoverShutdown()` instead of being the return value of `performTakeoverShutdown()`. This also generally eliminates `TakeoverPromise`.
Reviewed By: simpkins
Differential Revision: D20744151
fbshipit-source-id: 60f0c273b4f3889b53586d79efd95bfb27256e1b
Summary:
D20846826 added a dependency from the fuse library to the telemetry code,
so the CMakeLists.txt file needs to be updated.
Reviewed By: genevievehelsel
Differential Revision: D21083715
fbshipit-source-id: 823cc2eb128808d0e807c6b91cacc9fd91cdad48
Summary:
We got a user request to add this output after a restart. This (` run "cd / && cd -" to
update your shell's working directory.`) is the output from eden doctor when it detects stale mount points. I don't think it hurts to add, especially since new customers may not make the connection/have the context to deduce that "programs" in this message also apply to the user's shell.
Reviewed By: kmancini
Differential Revision: D20971070
fbshipit-source-id: 3448651cae90b2b5c8c4d2432b946521cdc5a292
Summary: RSRoutingHandler is now added by default
Reviewed By: bithree
Differential Revision: D21058633
fbshipit-source-id: 7d7607a5c5c7c3a5ed70259496c5f036c6fa8e4c
Summary:
This refactors the `edenfsctl start` command so that we more clearly split the
functionality into two pieces:
* Starting EdenFS as a service
* Running EdenFS in the foreground
In most normal situations in production the `start`, `restart`, and `stop`
commands are used to manage running EdenFS as a service. In the future I
believe our service management logic will start to diverge a bit more on Linux
vs Mac vs Windows, and this should help isolate the service-management code a
bit more cleanly.
The foreground behavior is mainly only used by developers during testing and
during the integration tests. Several options like `--gdb` and `--strace` are
only allowed in foreground mode, and this refactoring makes that clearer. In
the future we may also want to further restrict this, to allow only
specifying additional custom arguments and a custom binary path when running
in foreground mode. However, for now I have not updated that as I believe
some of our integration tests may be exercising this behavior today.
This change also cleans up some of the platform-specific code, and lets them
share more of the logic to construct arguments for edenfs. With this change
`edenfsctl start --foreground` now works on Windows.
Reviewed By: pkaush
Differential Revision: D20833244
fbshipit-source-id: 0f09d59702d8b64ca8f4fedccbc30da1c858afb4
Summary:
Update the `edenfsctl` and `edenfs` code so that `edenfsctl stop` works on
Windows.
Reviewed By: pkaush
Differential Revision: D20854616
fbshipit-source-id: 9a51cdc1f1d1838c5089b945df1fb624a3eaedb7
Summary:
- Catch the Windows-specific exceptions types thrown when attempting to open
the socket if EdenFS is not running, and convert this to an EdenNotRunning
exception.
- Update EdenFS to write its pid to a separate file, in addition to the normal
lock file, and have `edenfsctl` read this file instead of the lock file on
Windows. Other processes cannot read the lock file while EdenFS is running
and holding the lock, so it is nice to have the pid written in an alternate
location.
Reviewed By: pkaush
Differential Revision: D20854615
fbshipit-source-id: 1c8e8f402eb17dd012d03e11fbb662f493d9362d