90919293949596979899100
try { Thread.sleep(3000); h.failNextCheckpoint = true; standby.doCheckpoint(); fail("Should get IOException here"); } catch (Exception e) { } // checkpoint failed assertNotNull(h.lastSignature);
9899100101102103104105106107108
// checkpoint failed assertNotNull(h.lastSignature); h.failNextCheckpoint = false; standby.doCheckpoint(); // checkpoint succeeded assertNull(h.lastSignature); h.failNextCheckpoint = true; try {
104105106107108109110111112113114
// checkpoint succeeded assertNull(h.lastSignature); h.failNextCheckpoint = true; try { standby.doCheckpoint(); fail("Should get IOException here"); } catch (Exception e) { } // checkpoint failed -> now reading edits.new
129130131132133134135136137138139
AvatarNode standby = cluster.getStandbyAvatar(0).avatar; try { Thread.sleep(3000); h.failNextCheckpoint = true; standby.doCheckpoint(); fail("Should get IOException here"); } catch (IOException e) { } // checkpoint did not succeed assertNotNull(h.lastSignature);
136137138139140141142143144145146
} catch (IOException e) { } // checkpoint did not succeed assertNotNull(h.lastSignature); try { standby.doCheckpoint(); fail("Should get IOException here"); } catch (IOException e) { } // checkpoint did not succeed assertNotNull(h.lastSignature);
144145146147148149150151152153154
// checkpoint did not succeed assertNotNull(h.lastSignature); try { h.alterSignature = true; standby.doCheckpoint(); fail("Checkpoint should not succeed and throw RuntimeException"); } catch (Exception e) { LOG.info("Expected exception : " + e.toString()); } }
164165166167168169170171172173174
AvatarNode standby = cluster.getStandbyAvatar(0).avatar; try { Thread.sleep(3000); h.failNextCheckpoint = true; standby.doCheckpoint(); fail("Should get IOException here"); } catch (IOException e) { } // checkpoint failed assertNotNull(h.lastSignature);
177178179180181182183184185186187
Thread.sleep(2000); standby = cluster.getStandbyAvatar(0).avatar; h.failNextCheckpoint = false; standby.doCheckpoint(); // checkpoint succeeded assertNull(h.lastSignature); createEdits(20); standby.quiesceStandby(getCurrentTxId(primary)-1);
200201202203204205206207208209210
createEdits(20); AvatarNode primary = cluster.getPrimaryAvatar(0).avatar; AvatarNode standby = cluster.getStandbyAvatar(0).avatar; Thread.sleep(3000); standby.doCheckpoint(); assertTrue(h.ingestRecreatedAfterFailure); h.simulateEditsNotExists = false; createEdits(20); standby.quiesceStandby(getCurrentTxId(primary)-1);
222223224225226227228229230231232
setUp(); createEdits(20); AvatarNode standby = cluster.getStandbyAvatar(0).avatar; try { standby.doCheckpoint(); fail("Should get IOException here"); } catch (IOException e) { } } private void testQuiesceInterruption(InjectionEvent event, boolean scf) throws Exception {