Tested with:
=== modified file 'galera/src/replicator_str.cpp' --- galera/src/replicator_str.cpp 2013-11-02 17:21:57 +0000 +++ galera/src/replicator_str.cpp 2013-12-15 10:57:57 +0000 @@ -766,6 +766,7 @@ { log_fatal << "receiving IST failed, node restart required: " << e.what(); + st_.mark_corrupt(); gcs_.close(); gu_abort(); }
and it zeroed the grastate correctly on IST error.
However, as the error states there may be other exceptions which node restart may fix - network issues for instance.
So, it is better to mark this closer to where it happens..
=== modified file 'galera/src/replicator_str.cpp' --- galera/src/replicator_str.cpp 2013-11-02 17:21:57 +0000 +++ galera/src/replicator_str.cpp 2013-12-15 11:46:20 +0000 @@ -752,7 +752,15 @@ // processed on donor, just adjust states here trx->set_state(TrxHandle::S_REPLICATING); trx->set_state(TrxHandle::S_CERTIFYING); - apply_trx(recv_ctx, trx); + try + { + apply_trx(recv_ctx, trx); + } + catch (gu::Exception& e) + { + st_.mark_corrupt(); + throw; + } } } else
Tested with:
=== modified file 'galera/ src/replicator_ str.cpp' src/replicator_ str.cpp 2013-11-02 17:21:57 +0000 src/replicator_ str.cpp 2013-12-15 10:57:57 +0000
<< e.what();
gcs_. close() ;
gu_abort( );
--- galera/
+++ galera/
@@ -766,6 +766,7 @@
{
log_fatal << "receiving IST failed, node restart required: "
+ st_.mark_corrupt();
}
and it zeroed the grastate correctly on IST error.
However, as the error states there may be other exceptions which
node restart may fix - network issues for instance.
So, it is better to mark this closer to where it happens..
=== modified file 'galera/ src/replicator_ str.cpp' src/replicator_ str.cpp 2013-11-02 17:21:57 +0000 src/replicator_ str.cpp 2013-12-15 11:46:20 +0000
// processed on donor, just adjust states here
trx->set_ state(TrxHandle ::S_REPLICATING );
trx->set_ state(TrxHandle ::S_CERTIFYING) ;
--- galera/
+++ galera/
@@ -752,7 +752,15 @@
- apply_trx(recv_ctx, trx);
+ try
+ {
+ apply_trx(recv_ctx, trx);
+ }
+ catch (gu::Exception& e)
+ {
+ st_.mark_corrupt();
+ throw;
+ }
}
}
else