Commit Graph

8 Commits

Author SHA1 Message Date
Katie Mancini
af70a36a41 introduce metadata importer
Summary:
This will allow adding custom MetadataImporters in different eden builds.

DefaultMetadataImporter provides a no-op version of the interface to be
used by default.

Reviewed By: chadaustin

Differential Revision: D21960834

fbshipit-source-id: aec8a3627ab1223f74466b92a0ebe3290b67b7ed
2020-07-10 16:03:32 -07:00
Genevieve Helsel
9944a5dff5 add EdenServer recovery step and recover after failed takeover data send handshake
Summary:
* This adds a `EdenServer::recover()` method to start back up on unsuccessful takeover data send.
    * On an unsuccessful ping, filfill the `shutdownPromise` with a `TakeoverSendError` continaing the constructed `TakeoverData`. After this `recover` function is called, `takeoverPromise_` is reset, `takeoverShutdown` is set to `false`, and the `runningState_` is set to `RUNNING`.
With taking over from the returned `TakeoverData`, the user will not encounter `Transport not connected` errors on recovery.

* This adds a `EdenServer::closeStorage()` method to defer closing the `backingStore_` and `localStore_` until after our ready handshake is successful.
* This defers the shutdown of the `PrivHelper` until a successful ready handshake.

I also update the takeover documentation here with the new logic (and fix some formatting issues)

Reviewed By: simpkins

Differential Revision: D20433433

fbshipit-source-id: f59e660922674d281957e80aee5049735b901a2c
2020-04-07 09:52:21 -07:00
Chad Austin
45fd5b58b0 split runEdenMain out from EdenMain
Summary:
In preparation for building a single binary that can run inside and
outside of the corp environment, restructure EdenMain to allow
selecting the implementation at runtime.

Reviewed By: simpkins

Differential Revision: D20613464

fbshipit-source-id: 56dbf006f6e9fd74af9c490a47c832a5367d3d3d
2020-03-26 16:19:25 -07:00
Chad Austin
987dd994b6 add a StructuredLogger instance to ServerState
Summary:
Allocate and hook up a StructuredLogger at startup if the EdenConfig
has the appropriate values set.

Reviewed By: simpkins

Differential Revision: D18071821

fbshipit-source-id: 3996b6644bbf0c16bb3b9950d57a79d4619a1656
2019-11-13 15:23:38 -08:00
Genevieve Helsel
d8445bae2c save version number in EdenServer
Summary:
This saves the version number (like 20191014-154333) in the EdenServer. This will be returned to the user in a getScmStatusV2 call later up the stack. This is useful for being able to warn the user if EdenFS is running on an old or known-bad version.

I ended up splitting up `getEdenfsVersion()` and `getEdenfsBuildName()` because I don't think we need to store "edenfs " with every version number in the server / return this from the thrift call of `getScmStatusV2()`. Not sure of the use case of having "edenfs " prepended to the version number returned from the current `getEdenfsBuildName()` so didn't want to change that, but if it seems fine we could remove that prepended edenfs (or if it actually makes sense to return the string with that prepended from the ScmStatus call).

Reviewed By: chadaustin

Differential Revision: D17919528

fbshipit-source-id: 5abdf7851371c4614da862657350a8cc263eb014
2019-10-24 12:48:33 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Adam Simpkins
aa5e6c7295 update license headers in C++ files
Summary:
Update the copyright & license headers in C++ files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487078

fbshipit-source-id: 19f24c933a64ecad0d3a692d0f8d2a38b4194b1d
2019-06-19 17:02:45 -07:00
Adam Simpkins
84349add33 rename some of the files related to main()
Summary:
Rename `main.cpp` to `EdenMain.cpp` now that this contains the `EdenMain`
class rather than the top-level `main()` function, and rename `RunServer.cpp`
to `main.cpp`

Reviewed By: pkaush

Differential Revision: D14435306

fbshipit-source-id: e1528a773e0724c6bd50e31f6b33a1762d7bd49e
2019-03-15 18:13:58 -07:00