Revert "Revert "main: change order between storage service and drain execution during exit""

This reverts commit b3ed55be1d.

The issue is in the failing dtest, not this commit. Gleb writes:

  "The bug is in the test, not the patch. Test waits for repair session
   to end one way or the other when node is killed, but for nodetool to
   know if repair is completed it needs to poll for it.  If node dies
   before nodetool managed to see repair completion it will stuck
   forever since jmx is alive, but does not provide answers any more.
   The patch changes timing, repair is completed much close to exit now,
   so problem appears, but it may happen even without the patch.

   The fix is for dtest to kill jmx as part of killing a node
   operation."

Now that Lucas fixed the problem in scylla-ccm, revert the revert.
This commit is contained in:
Pekka Enberg
2016-06-01 08:48:50 +03:00
parent f27e5d2a68
commit 0255318bf3

View File

@@ -595,10 +595,10 @@ int main(int ac, char** av) {
supervisor_notify("serving");
// Register at_exit last, so that storage_service::drain_on_shutdown will be called first
engine().at_exit([] {
return service::get_local_storage_service().drain_on_shutdown();
return repair_shutdown(service::get_local_storage_service().db());
});
engine().at_exit([] {
return repair_shutdown(service::get_local_storage_service().db());
return service::get_local_storage_service().drain_on_shutdown();
});
engine().at_exit([&db] {
return db.invoke_on_all([](auto& db) {