Commit Graph

295 Commits

Author SHA1 Message Date
Ailin Zhang
fb5d18666a allow specifying a mount for 'eden debug gc_process_fetch'
Summary: If the user specifies a mount, only clear for that mount, otherwise clear for all mounts.

Reviewed By: fanzeyi

Differential Revision: D22674210

fbshipit-source-id: 832c4fd37a63fdb44cb12844378b61d113731016
2020-07-23 11:54:12 -07:00
Ailin Zhang
20ae54a69b clear fetch counts using eden debug gc_process_fetch
Summary: add a thrift call to clear `pidFetchCount_` in `ObjectStore` and call it in `eden debug gc_process_fetch`. Users might want this command to start a new recording of process fetch counts.

Reviewed By: kmancini

Differential Revision: D22583430

fbshipit-source-id: eba7d63b08da5134fd09b7512895aba06f6a7ca5
2020-07-23 11:54:12 -07:00
generatedunixname89002005287564
839c31572e Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D22661583

fbshipit-source-id: feb6b7fddee4809d8d089dd6eb51aa3f7185faed
2020-07-22 04:35:29 -07:00
Victor Zverovich
e3f4a56f6b Migrate to field_ref Thrift API
Summary:
We are unifying C++ APIs for accessing optional and unqualified fields:
https://fb.workplace.com/groups/1730279463893632/permalink/2541675446087359/.

This diff migrates code from accessing data members generated from unqualified
Thrift fields directly to the `field_ref` API, i.e. replacing

```
thrift_obj.field
```

with

```
*thrift_obj.field_ref()
```

The `_ref` suffixes will be removed in the future once data members are private
and names can be reclaimed.

The output of this codemod has been reviewed in D20039637.

The new API is documented in
https://our.intern.facebook.com/intern/wiki/Thrift/FieldAccess/.

drop-conflicts

Reviewed By: yfeldblum

Differential Revision: D22631599

fbshipit-source-id: 9bfcaeb636f34a32fd871c7cd6a2db4a7ace30bf
2020-07-21 11:23:35 -07:00
Ailin Zhang
c33f8ba494 add PID-fetchCount map data to the result of getAccessCounts
Summary:
This diff updates `getAccessCounts` to
- obtain the PID-fetchCount map data added in the previous diff
- put that data into its `result`

Reviewed By: kmancini

Differential Revision: D22101232

fbshipit-source-id: 1d41715339d418b03c17f6c93a7a497b432973ae
2020-06-24 15:36:51 -07:00
Zeyi (Rice) Fan
ec622e8e1c start to accept ObjectFetchContext to InodeBase::stat()
Summary: This diff makes `InodeBase::stat()` to be able to accept `ObjectFetchContext` as a parameter.

Reviewed By: chadaustin

Differential Revision: D21780883

fbshipit-source-id: 9b1db2e2268cb98663bcf902ea61897da593ea05
2020-06-18 10:40:41 -07:00
Ailin Zhang
ec906443ea print fsck to stdout
Summary: This diff passes a callback function `progressCallback` from `EdenServer` to make `OverlayChekcer` print fsck messages to stdout.

Reviewed By: fanzeyi

Differential Revision: D21966060

fbshipit-source-id: 317b2c8954c718b51b5295c9f8d7698eb203906e
2020-06-12 12:34:55 -07:00
Chad Austin
a06da8f73c ensure that EdenError messages are always valid UTF-8
Summary:
Some Thrift clients require that values of type `string` must contain
valid UTF-8, and fail to decode otherwise. Ensure that EdenError's
message is always valid UTF-8.

Reviewed By: fanzeyi

Differential Revision: D21890761

fbshipit-source-id: 93b554e0bc6648c685f5fa54612576bd95d95ae5
2020-06-10 19:29:51 -07:00
Ailin Zhang
1b159d58b9 fix __isset deprecated problem
Summary: This diff fixes `'__isset' is deprecated` problem when building `//eden/fs/service:edenfs`

Reviewed By: simpkins

Differential Revision: D21966922

fbshipit-source-id: c3b12134f3f84db0a97f3975dae5d64a2c98641a
2020-06-10 19:29:49 -07:00
TJ Yin
65d6a4d886 Remove thrift setters
Summary:
Thrift setter API is deprecated since it doesn't bring any value over direct assignment. Removing it can reduce build-time and make our codebase more consistent.

If result of `s.set_foo(bar)` is unused, this diff replaces

    s.set_foo(bar);

with

    s.foo_ref() = bar;

Otherwise, it replaces

    s.set_foo(bar)

with

    s.foo_ref().emplace(bar)

Reviewed By: chadaustin

Differential Revision: D21712029

fbshipit-source-id: 3a332b4bf6fac6b3cf396d34e6d5ca4849181a6d
2020-05-26 12:38:37 -07:00
Jessica Gomes
50022171c9 add uptime field to DaemonInfo
Summary:
- Added uptime field to DaemonInfo thrift struct
- Created startTime member variable in EdenServer
- Made appropriate refactoring changes to EdenMain and EdenServer
- Changed main.py and util.py to use the new uptime value

Reviewed By: genevievehelsel

Differential Revision: D21471140

fbshipit-source-id: 8868de667dfb95de93e3e71b90c0412fb3825388
2020-05-11 11:42:15 -07:00
Xavier Deguillard
018da41a93 service: enable several service handlers
Summary:
All of these were simply NOT_IMPLEMENTED on Windows, but the code compiles
and doesn't break any existing tests. The underlying called functions might
have been implemented already, or are NOT_IMPLEMENTED, either way, this reduces
the amount of `#ifdef _WIN32`.

Reviewed By: chadaustin

Differential Revision: D21405622

fbshipit-source-id: bdc2de41d6a57e1c0b532e76eeb2c0c86180d558
2020-05-07 09:52:18 -07:00
Chad Austin
836429c71b add TODO comments for optimizing getEntryInformation and getFileInformation
Reviewed By: genevievehelsel

Differential Revision: D21310220

fbshipit-source-id: 6614175881395c8ed921054a7ee5f81f011bb85c
2020-04-29 17:52:02 -07:00
Wez Furlong
28706ca81b eden: implement getFileInformation on windows
Summary:
The operation originally wanted to operate on the fuse `Attr`
structure which we don't have on Windows, so I repurposed the
`InodeBase::getattr` into `InodeBase::stat` and moved the conversion
of `struct stat` to `Dispatcher::Attr` to the `EdenDispatcher::getattr`
method (and a couple of other adhoc places that were doing a similar
conversion).

Reviewed By: chadaustin

Differential Revision: D20562459

fbshipit-source-id: 6b538110038352e9b5590fcb5ff5c33fe84ac1d8
2020-04-28 22:10:15 -07:00
Chad Austin
61e738cd84 use enumValue instead of static_cast<int>
Summary:
Where appropriate, replace uses of `static_cast<int>` with
`enumValue`.

Reviewed By: simpkins

Differential Revision: D20975196

fbshipit-source-id: 581643366ea7eda5d1961238b0693cf45c4eec94
2020-04-28 18:59:34 -07:00
Chad Austin
04718d3395 assert that the dtype constants have consistent values on all platforms
Summary:
It turns out that macOS, FreeBSD, and Linux all agree on the values
for dtype. If we assume dtype is just the high nibble of mode_t
shifted right by 12, then the Windows CRT agrees too. So hardcode the
values in eden.thrift and add appropriate static_asserts. This opens
the possibility of simply static_cast'ing the numeric values in
Watchman.

Reviewed By: simpkins

Differential Revision: D20975101

fbshipit-source-id: 354ffcbdf3f1d5f8b1715abf1026eaea429d16cf
2020-04-28 13:23:52 -07:00
Chad Austin
9e4446bbee rename DType to OsDType in preparation for creation of an enumeration
Summary:
enums and i16 are not serialization-compatible in Thrift, but we want
an enumeration with defined values for dtypes. Rename the existing
Dtype type to OsDtype in preparation for introducing the Dtype enum.

Reviewed By: simpkins

Differential Revision: D20974559

fbshipit-source-id: 5d9087a79e7fd59b99b257a99351a8287ba00b5f
2020-04-28 11:09:46 -07:00
Chad Austin
447cc2f0a7 add getEntryInformation thrift API
Summary:
Add a getEntryInformation Thrift call that allows looking up existence
and dtype without fetching blobs. There is still plenty of room for
improving this - we don't need to allocate inodes for every path to
satisfy this query.

Reviewed By: genevievehelsel

Differential Revision: D20974514

fbshipit-source-id: e7fe5b6bd789aaadbb8295c3d69099cb2f17debd
2020-04-27 21:50:34 -07:00
Wez Furlong
a2825aa8ce eden: enable getFilesChangedSince on Windows
Summary: as above

Reviewed By: pkaush

Differential Revision: D20562533

fbshipit-source-id: 25ed291fc7c8ec61f2a3fcd21debf14dedd990e1
2020-04-27 09:18:42 -07:00
Wez Furlong
fc2abaec02 eden: add stattimes helpers for win32
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
2020-04-24 15:57:27 -07:00
Wez Furlong
15f27eae3f eden: enable globFiles on windows
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
2020-04-24 15:57:27 -07:00
Wez Furlong
2b3f085bd8 eden: thrift enable basic journal APIs on Windows.
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
2020-04-24 15:57:26 -07:00
Puneet Kaushik
be9628b2bc Enable hg update on Eden Windows
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
2020-04-24 12:46:19 -07:00
Puneet Kaushik
33631031d7 Enable hg status on Eden Windows
Reviewed By: simpkins

Differential Revision: D20480863

fbshipit-source-id: 01289bd02d0fd1f447c18484c29324450125aeeb
2020-04-24 12:46:19 -07:00
Chad Austin
7df52781c8 automatically register histograms for all EdenService functions
Summary:
Instead of manually enumerating every method defined in eden.thrift to
enable histogram statistics, use Thrift's own metadata.

Reviewed By: genevievehelsel

Differential Revision: D20929642

fbshipit-source-id: 5a54eb03e75fcd08cf653e2c53a78c8137ba9553
2020-04-13 14:13:02 -07:00
Chad Austin
ba88d4f1d2 enable Thrift function histograms on Windows
Summary: Now that fb303's Thrift function histogram support is open sourced, remove the _WIN32 ifdefs.

Reviewed By: simpkins

Differential Revision: D20907360

fbshipit-source-id: bb72dda0c801ca1bba4866d26645148881630596
2020-04-09 11:30:27 -07:00
Adam Simpkins
c0d6deaae1 remove the deprecated debugSetLogLevel() thrift API
Summary:
Using `setOption("logging", config)` is the preferred way to update the
logging configuration.  This older API is no longer needed, and I don't
believe anything should be using it any more.

Reviewed By: genevievehelsel

Differential Revision: D20876083

fbshipit-source-id: c0b40c61535bee2363f273345cbce818389de6b7
2020-04-06 18:53:00 -07:00
Lee Howes
dead099771 Rename collectXSemiFuture to collectX
Summary:
Migration from Future-returning executor-erasing collectX forms to
SemiFuture-returning forms, that are less risky in particular with coroutines.

Earlier changes added collectXSemiFuture and collectXUnsafe as a migration
path. We then migrated collectX callsites to collectXSemiFuture or
collectXUnsafe and switched the implementation of collectX to the SemiFuture
form.

This diff renames uses of collectXSemiFuture to collectX, as the two are
identical.

Reviewed By: simpkins

Differential Revision: D20833464

fbshipit-source-id: c14aa40f8cce121632ff922300ef271721c1d695
2020-04-03 17:15:08 -07:00
Chad Austin
6db8f0fefd use TEnumTraits
Summary:
The _NAME_TO_VALUES and _VALUES_TO_NAMES fields are almost deprecated,
so instead use TEnumTraits.

Reviewed By: simpkins

Differential Revision: D20708754

fbshipit-source-id: 2a5107ee1299b4160f38ca6cddf90416745f6141
2020-03-27 15:27:02 -07:00
Chad Austin
d6d49724a6 use a kServiceName constant and rename the service from Eden to EdenFS
Summary:
I'm about to add another reference to our service name, so instead of
hardcoding "Eden", add a kServiceName constant. While I'm at it, I
renamed it to EdenFS.

Reviewed By: genevievehelsel

Differential Revision: D20500668

fbshipit-source-id: 4974363156ba2934a1a5cd86d9e8fd7e93d89181
2020-03-25 22:02:56 -07:00
Chad Austin
68aa376681 switch getFileInformation to semifuture
Summary:
Instead of explicitly running results on the Thrift thread manager
executor, use the semifuture implementation of the Thrift method which
does the same thing automatically.

Reviewed By: fanzeyi

Differential Revision: D20481540

fbshipit-source-id: 5f23c0193514fce20d80e3292bfa7402f4448e38
2020-03-23 19:38:03 -07:00
Ratnadeep Joshi
8e4b04107c Add an option to mount a checkout read-only
Summary: Added option to mount command

Reviewed By: chadaustin

Differential Revision: D20256352

fbshipit-source-id: e52fbd10f318221777b7e2d21ed9ba0a17ce1687
2020-03-11 21:38:48 -07:00
Lee Howes
f15fdeec84 collectX to collectUnsafe
Summary:
Migration from Future-returning executor-erasing collectX forms to
SemiFuture-returning forms, that are less risky in particular with coroutines.

Earlier diffs added SemiFuture and Unsafe versions. This codemod migrates
collect versions to the Unsafe versions to allow the basic collect versions to
be made safe.

Reviewed By: simpkins

Differential Revision: D20331206

fbshipit-source-id: efc8dff487d45f7d53ee55e8c4696bd3eed0e6da
2020-03-10 11:36:09 -07:00
Adam Simpkins
0642f1618d report the fb303 status in the getDaemonInfo() result
Summary:
Update the thrift `getDaemonInfo()` call to also return the fb303 status.
This allows the CLI to make a single thrift call instead of 2 when checking if
the EdenFS daemon is healthy.

Reviewed By: genevievehelsel

Differential Revision: D20130406

fbshipit-source-id: 9d25341e1d5f82fb1a921e1d7b1ebd34bcf19dc8
2020-02-26 21:03:52 -08:00
James Zuo
73e1521a4e Remove deprecated method createStreamPublisher in EdenServiceHandler
Summary: Remove deprecated method createStreamPublisher with apache::thrift::ServerStream<T>::createPublisher()

Reviewed By: iahs

Differential Revision: D19961754

fbshipit-source-id: 915645f1aff648d65f54246e008fbc4454b71684
2020-02-20 09:33:07 -08:00
Chad Austin
fc07c3b6e6 add an ObjectFetchContext interface
Summary:
Add a fetch context interface to ObjectStore that allows tracing cache
hits, backing store fetches, and fetch durations in the context of a
diff or checkout operation.

Reviewed By: simpkins

Differential Revision: D19135625

fbshipit-source-id: d0d8f134b1c89f7ba4971a404a46a69a1704ba5c
2020-02-05 13:15:01 -08:00
Puneet Kaushik
32cc7c1eca Enable listMounts to get eden list working
Reviewed By: simpkins

Differential Revision: D19510624

fbshipit-source-id: e097c5b412e62d6856179db971296f8389ec8991
2020-01-23 12:41:39 -08:00
Chad Austin
bf4441ee86 use unicode micro symbol when logging thrift call durations
Summary: µ

Reviewed By: wez

Differential Revision: D19191188

fbshipit-source-id: 287d208808d782179ce9e70c323f8dd45e5168c3
2020-01-08 14:43:25 -08:00
Chad Austin
91eda6e3e3 fix cmake build
Summary:
D19135344 broke EdenFS's cmake builds, and our macOS releases haven't
been going out. Rather than pass the same streaming options to the
Thrift compiler in the CMake build, remove deprecated_server_streams
from both builds.

Reviewed By: simpkins

Differential Revision: D19204397

fbshipit-source-id: c22e634ded82a683daff5c92182c8a1eb1ed4d21
2020-01-08 14:08:34 -08:00
Chad Austin
844b569d2a make EdenMount::getRootTree return a future
Summary:
EdenMount offered both getRootTree and getRootTreeFuture. Replace the
former with the latter and adjust remaining callers.

Reviewed By: genevievehelsel

Differential Revision: D18666585

fbshipit-source-id: 961361a1fb545e48db0ece970bb5e6ffbca8efef
2019-12-20 16:14:18 -08:00
Chad Austin
b75b10bc33 kill ObjectStore::getBlobMetadata
Summary:
The last remaining user of ObjectStore::getBlobMetadata was a debug
Thrift call. Remove it and update the Thrift call to use getBlobSize
and getBlobSha1.

Reviewed By: pkaush

Differential Revision: D18663376

fbshipit-source-id: 86baefc9004a07aac4ddf5849870431be04c75f2
2019-12-20 16:14:18 -08:00
Adam Simpkins
d0ba23f47a decrease the log level of globFiles() thrift calls
Summary:
D18820280 increased the log level for `globFiles()` calls from DBG3 to DBG2.
However, buck and other tools often end up huge numbers of glob calls, and
this ends up causing log spam.

This change reduces the log level of `globFiles()` back to DBG3.  In a
subsequent diff I will update the code to increase the log level for slow
calls.  This does mean that we will only get a log message for slow glob calls
after the call completes, but this is better than not getting a message at
all.

Reviewed By: pkaush

Differential Revision: D18924780

fbshipit-source-id: 86e83614f51424aca078e4de8a56c45018a6d286
2019-12-10 20:18:36 -08:00
Puneet Kaushik
eb17a5bde8 Enable getScmStatusBetweenRevisions
Summary: Enabling getScmStatusBetweenRevisions to work on Windows and its tests.

Reviewed By: simpkins

Differential Revision: D18431271

fbshipit-source-id: eee82538e2fc3d7e371c96fc271cd9662ea6d737
2019-12-10 14:07:26 -08:00
Puneet Kaushik
e19f84aa65 Add resetParents to enable hg commit
Summary:
A successful run of hg commit ends in call to resetParents() to reset the current parent commit.

We also need resetParent to run the Status tests.

Reviewed By: genevievehelsel

Differential Revision: D18439954

fbshipit-source-id: 44f7a009e050bd5e2130d8c4fc3a85a8ec3bfad1
2019-12-10 14:07:24 -08:00
Puneet Kaushik
86f5c839d1 Add EdenMount diff to generate the ScmStatus
Summary: This implements diff() inside EdenMount which uses GenerateStatus to compute the ScmStatus.

Reviewed By: simpkins

Differential Revision: D18195574

fbshipit-source-id: 16cfbda35796d1cfd4e13e6566b7ac222163aea4
2019-12-10 14:07:24 -08:00
Adam Simpkins
cf4ef20aaa increase the log level for globFiles() thrift calls
Summary:
Increase the log level for messages about `globFiles()` thrift calls so that
they are enabled by default in our normal production configuration.

`globFiles()` calls can potentially cause EdenFS to fetch a lot of data, so it
is useful to be able to see them in the logs when investigating performance
issues.

Reviewed By: genevievehelsel

Differential Revision: D18820280

fbshipit-source-id: e351a9541e420f5eb47ca14d6620366437773ce4
2019-12-04 16:29:12 -08:00
Adam Simpkins
e07f8bd7b6 refactor the EDEN_BUG() macro
Summary:
This splits `EDEN_BUG()` into three separate version.  All three crash in
debug mode builds, but in release builds they behave differently:

- `EDEN_BUG()` throws an exception
- `EDEN_BUG_FUTURE(Type)` returns a `folly::Future<Type>` that has been
  fulfilled with an exception.
- `EDEN_BUG_EXCEPTION()` returns a `folly::exception_wrapper`.

The main advantage of this is that this allows the compiler to detect that
`EDEN_BUG()` can never return.  Previously `EDEN_BUG()` was used for all 3 of
these different cases, and its behavior depended on whether `toException()`
was ever called.  As a result we could not easily get the compiler to identify
code paths where we know at compile time that it will never return.

Reviewed By: chadaustin

Differential Revision: D18652103

fbshipit-source-id: 070107c7520f51b05696905fa243de5f8df15958
2019-11-22 15:38:33 -08:00
Chad Austin
46b25acec8 introduce CheckoutResult struct
Summary:
We're about to return more information from checkout, so
introduce a CheckoutResult struct.

Reviewed By: genevievehelsel

Differential Revision: D18630820

fbshipit-source-id: 78b68ef3551ca8c9e9968631de554084c333b4b9
2019-11-21 11:50:46 -08:00
Genevieve Helsel
a47b831d54 stop processing getScmStatusV2() calls if the thrift connection is closed
Summary: make `future_getScmStatusV2` into `async_tm_getScmStatusV2` so we can short circut the status call if the request is no longer active.

Reviewed By: simpkins

Differential Revision: D18378212

fbshipit-source-id: b2bca014a37d99f7a92478c3e23bde0b874dd13c
2019-11-20 18:06:33 -08:00
Genevieve Helsel
3807e751ca make enforceParents configurable for getScmStatusV2
Summary: This reads `enforceParents` from a config instead of always assuming true for `getScmStatusV2()`. This will allow a easy kill switch in case throwing errors from this thrift call causes issues with something that calls hg status

Reviewed By: simpkins

Differential Revision: D18258164

fbshipit-source-id: 1ae421a941c01a678d25d5453c771262b03558d0
2019-11-20 17:51:21 -08:00