Summary: This diff allows watchman to connect to `EdenServer` over an rsocket stream.
Reviewed By: simpkins, strager
Differential Revision: D15900246
fbshipit-source-id: e4a99fcd7b9c75b6ad2c331c1bbf13d22f78cfd7
Summary: ThriftCppLibrary.cmake is a duplicate of the getdeps/opensource copy of the file. To avoid issues with keeping them in sync, remove Eden's.
Reviewed By: simpkins
Differential Revision: D15750453
fbshipit-source-id: 7f95d01c4ed6ce3af86f0215ef16b88dc2c61027
Summary: Add a stub for this so we can use it in some the Eden code.
Reviewed By: chadaustin
Differential Revision: D15831519
fbshipit-source-id: 8f16d8fcb7080d207c748281bd93b9243c104596
Summary:
Update `RocksDbLocalStore::getApproximateSize()` to use `DB::GetIntProperty()`
rather than `DB::GetApproximateSizes()`.
The `GetIntProperty()` call reports properties about the overall column
family, as opposed to `GetApproximateSizes()` which supports querying size
information for specific key ranges. We always want data about the full
table, so the `GetIntProperty()` call seems to make more sense for us.
Also change the code to include both the SST file size (which we were querying
before) and the memtable size (which was not included before). The
`GetApproximateSizes()` call allow this to be queried too, but using
`GetIntProperty()` still seems better since we don't care about a specific key
range.
Reviewed By: wez
Differential Revision: D15798506
fbshipit-source-id: 86d087876d838c0ff4ae517ccac2e8b8bf31e304
Summary:
Add a debug log message at the end of each PeriodicTask iteration, reporting
how long the task took.
Reviewed By: wez
Differential Revision: D15798504
fbshipit-source-id: 3f33877cb4a9ddb8d966877b005e6d4c60d7dbe0
Summary:
Add a periodic task to reload the configuration file from disk. By default
this runs once every 5 minutes, but this interval can be controlled from the
config file.
At the moment reloading the config file does not do much other than update the
interval for how frequently the config file is reloaded. However, I plan to
add additional periodic tasks shortly that are controlled by this config
setting.
This will also make it possible for other parts of the code to
access the config settings in the `ServerState` and use them as-is without
checking to see if they reloaded. Currently all of the code that accesses
config values performs a check to see if the config needs to be reloaded. If
we want to switch to Mercurial-style configs in the future that check will be
substantially more expensive.
This diff also includes a new thrift call to force the config file to be
reloaded immediately. This can be used to restart automatic config reloading
if it is ever disabled in the config file.
Reviewed By: wez
Differential Revision: D15756357
fbshipit-source-id: 1999f4730903633ce838842932a6ae6a65eda4e6
Summary:
Migrate the code from accessing optional Thrift fields directly to a safer
`optional_field_ref` API. See https://fburl.com/safe for more details.
The output of this codemod has been reviewed in D13259011.
To preserve semantics, each unchecked access is replaced with an explicit call
to `value_unchecked()`. If you are sure that accessing a field is safe (the
field is marked as set), you can later replace `value_unchecked()` with
`value()` or dereferencing (`operator *`):
```
ThriftStruct s = ...
- auto foo = s.foo_ref().value_unchecked();
+ auto foo = *s.foo_ref(); // will throw if s.foo is unset
```
drop-conflicts
Reviewed By: stevegury
Differential Revision: D15786632
fbshipit-source-id: 7c3f089dfa79597b189da6996cb76dcdbd5ed612
Summary: The first step towards decoupling size from the metadata object in the local store. This is necessary for the next step, which is to serialize size separately from the combined metadata object.
Reviewed By: chadaustin
Differential Revision: D15719637
fbshipit-source-id: 979555e3e362f2b698b3af3a0b6db1e350e07dcd
Summary: Wrote tests for retrieving hashes from the object store and refactored existing tests. Includes positive and negative tests.
Reviewed By: strager, pkaush
Differential Revision: D15697488
fbshipit-source-id: 44aa8a36fbc1d1e56dcbbb6bcb665d3784cbb476
Summary: `getSize` and `getSha1` were misleading function names, since the functions refer to the size and hash of a given blob and not the object store itself. These functions have been renamed to `getBlobSize` and `getBlobSha1`.
Reviewed By: chadaustin
Differential Revision: D15696510
fbshipit-source-id: 4dd31659f60969fa90d8e2b39f43c46a2b7dff7c
Summary: I decoupled the getSize() function from the getMetadata() function, using a naive implementation for now. This was necessary because I want to add support for fetching only the size of a blob during a request like `ls -l`. Right now, the size and hash of a blob are coupled in a Metadata object, so if the size is requested, the whole file must be downloaded to calculate the hash, which is expensive for large files.
Reviewed By: chadaustin, strager
Differential Revision: D15678216
fbshipit-source-id: 8f68692768faaae0e65373ffe608d09ae49bbc42
Summary: Fix a few more issues raised by our Python lint checks.
Reviewed By: wez
Differential Revision: D15776717
fbshipit-source-id: 621960579c4567c4fb9395ae14cd7a8666726c1c
Summary: Remove a number of unused imports detected by the linter.
Reviewed By: wez
Differential Revision: D15776268
fbshipit-source-id: 221f45d275664d037bbabcac9858b40266b4833e
Summary:
If the systemd user manager is not running (e.g. it crashed or was manually stopped), 'eden stop' fails with an unhelpful error message:
> pystemd.dbusexc.DBusConnectionRefusedError: [err -111]: Could not open a bus to DBus
or
> pystemd.dbusexc.DBusBaseError: [err -2]: Could not open a bus to DBus
Provide a better experience: tell the user the most likely cause, and suggest a solution:
> error: The systemd user manager is not running. Run the following command to start it, then try again:
> sudo systemctl start user@strager.service
Reviewed By: wez
Differential Revision: D13791023
fbshipit-source-id: 5172df0a52d21c311b27b8a527cad934f9882154
Summary:
We recently added a new thrift file to the codegen, but
forgot that the cli build also needs to be taught how to build
the python code for it.
Reviewed By: strager
Differential Revision: D15788134
fbshipit-source-id: 48a14f0a91b79cc4dceaddd281598cac773b7e11
Summary: HgCommand.h and related code isn't used anywhere. Delete it.
Reviewed By: simpkins
Differential Revision: D15773223
fbshipit-source-id: c4c116150bb74e29e4f220d3b0cbf988d4a1b1c5
Summary:
Summary
Change `ConfigTest` to derive directly from `EdenTestCase` rather than using
the `eden_repo_test` decorator. The configuration test code doesn't really
need a repository, and so we don't need to run it twice (for both Mercurial
and Git repositories).
Reviewed By: wez
Differential Revision: D15756359
fbshipit-source-id: 90d5011ae1ff7d2a251c9e7bb776045fbe2fdfe1
Summary:
Clean up the `EdenFS` class construction.
Previously it accepted the `eden_dir`, `etc_eden_dir`, and `home_dir`
arguments as separate parameters. If `etc_eden_dir` or `home_dir` were not
specified it would not pass these arguments to `edenfs`, allowing the default
values to be used. This is undesirable for most tests.
Now it accepts a `base_dir` argument. Explicit values for the `eden_dir`,
`etc_eden_dir`, and `home_dir` parameters can still be specified (this is used
for the snapshot tests), but if they aren't specified, default locations
inside the `base_dir` will be used instead.
This also cleans up some of the code to use `pathlib.Path` values instead of
plain `str` objects in more places.
Reviewed By: strager
Differential Revision: D15756358
fbshipit-source-id: 3e87ddc98d15fcb7f60c6c3116d4fcc8e49432ea
Summary:
Introduce a couple of globals that represent
the different stat results used in the test, and a helper
function to return the most common shape of the mount table.
Reviewed By: strager
Differential Revision: D15753258
fbshipit-source-id: 05d54d6098476464b0319615afb32da25431b2e6
Summary:
Parse the `mount` command output to understand the mount table on macOS.
This is helpful both for eden doctor and the upcoming redirection feature.
Reviewed By: strager
Differential Revision: D15701554
fbshipit-source-id: 6e17e1682dc609ae6f1e9f82bf7b9c729addea27
Summary:
For the redirect subcommand I wanted to automatically tabulate
some data to display it, so here's a little helper function.
The intent is that we pass a list of dictionaries with the data and let
the tabulate function render it for human consumption.
That same set of dictionaries could also be passed to a json serializer
for machine readable output (out of scope from this diff).
The tabulated data is intentionally limited in this current form:
* We make a run through and compute the max width of each column
* A simple header_labels map can be used to provide more human
readable versions of the dictionary keys as the column headers
* A missing header lable defaults to the uppercased version of
the dictionary key for that column
* Cell contents are all left aligned in their respective cell
Reviewed By: strager
Differential Revision: D15700886
fbshipit-source-id: e47a1ebc56edb0fd386bfda83865f946f5e782ce
Summary:
The eden/fs/store library depends on eden/fs/config. The changes in
D15428932 exposed a build failure due to this missing dependency.
Reviewed By: strager
Differential Revision: D15768197
fbshipit-source-id: 4482e3a9027fd49163af39d6887da709be810b0a