| 540 | |
| 541 | |
| 542 | Future<Option<Log::Position>> LogWriterProcess::_start() |
| 543 | { |
| 544 | // We delete the existing coordinator (if exists) and create a new |
| 545 | // coordinator each time 'start' is called. |
| 546 | // TODO(benh): We shouldn't need to delete the coordinator everytime. |
| 547 | delete coordinator; |
| 548 | error = None(); |
| 549 | |
| 550 | CHECK_READY(recovering); |
| 551 | |
| 552 | coordinator = new Coordinator(quorum, recovering.get(), network); |
| 553 | |
| 554 | LOG(INFO) << "Attempting to start the writer"; |
| 555 | |
| 556 | return coordinator->elect() |
| 557 | .then(defer(self(), &Self::__start, lambda::_1)) |
| 558 | .onFailed(defer(self(), &Self::failed, "Failed to start", lambda::_1)); |
| 559 | } |
| 560 | |
| 561 | |
| 562 | Option<Log::Position> LogWriterProcess::__start( |