sapling/eden/fs/takeover/TakeoverClient.h
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

31 lines
831 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include "eden/fs/takeover/TakeoverData.h"
#include "eden/fs/utils/PathFuncs.h"
namespace facebook {
namespace eden {
/**
* Request to take over mount points from an existing edenfs process.
*
* Returns a TakeoverData object on success, or throws an exception on error.
*/
TakeoverData takeoverMounts(
AbsolutePathPiece socketPath,
// the following parameters are present for testing purposes and should not
// normally be used in the production build.
bool shouldPing = true,
const std::set<int32_t>& supportedTakeoverVersions =
kSupportedTakeoverVersions);
} // namespace eden
} // namespace facebook