| 338 | |
| 339 | protected: |
| 340 | void initialize() override |
| 341 | { |
| 342 | LOG(INFO) << "Starting missing positions recovery"; |
| 343 | |
| 344 | // Register a callback to handle user initiated discard. |
| 345 | promise.future().onDiscard(defer(self(), &Self::discard)); |
| 346 | |
| 347 | // Check the current status of the local replica and decide if we |
| 348 | // proceed with recovery. We do it only if the local replica is in |
| 349 | // VOTING status. |
| 350 | chain = replica->status() |
| 351 | .then(defer(self(), &Self::recover, lambda::_1)) |
| 352 | .onAny(defer(self(), &Self::finished, lambda::_1)); |
| 353 | } |
| 354 | |
| 355 | void finalize() override |
| 356 | { |