MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
testBackup.cpp
1 /*
2  Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #include <NDBT.hpp>
19 #include <NDBT_Test.hpp>
20 #include <HugoTransactions.hpp>
21 #include <UtilTransactions.hpp>
22 #include <NdbBackup.hpp>
23 
24 int runDropTable(NDBT_Context* ctx, NDBT_Step* step);
25 
26 #define CHECK(b) if (!(b)) { \
27  g_err << "ERR: "<< step->getName() \
28  << " failed on line " << __LINE__ << endl; \
29  result = NDBT_FAILED; \
30  continue; }
31 
32 char tabname[1000];
33 
34 int
35 clearOldBackups(NDBT_Context* ctx, NDBT_Step* step)
36 {
37  strcpy(tabname, ctx->getTab()->getName());
38  NdbBackup backup(GETNDB(step)->getNodeId());
39  backup.clearOldBackups();
40  return NDBT_OK;
41 }
42 
43 int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){
44 
45  int records = ctx->getNumRecords();
46  HugoTransactions hugoTrans(*ctx->getTab());
47  if (hugoTrans.loadTable(GETNDB(step), records) != 0){
48  return NDBT_FAILED;
49  }
50  return NDBT_OK;
51 }
52 
53 bool testMaster = true;
54 bool testSlave = false;
55 
56 int setMaster(NDBT_Context* ctx, NDBT_Step* step){
57  testMaster = true;
58  testSlave = false;
59  return NDBT_OK;
60 }
61 int setMasterAsSlave(NDBT_Context* ctx, NDBT_Step* step){
62  testMaster = true;
63  testSlave = true;
64  return NDBT_OK;
65 }
66 int setSlave(NDBT_Context* ctx, NDBT_Step* step){
67  testMaster = false;
68  testSlave = true;
69  return NDBT_OK;
70 }
71 
72 int runAbort(NDBT_Context* ctx, NDBT_Step* step){
73  NdbBackup backup(GETNDB(step)->getNodeId()+1);
74 
75  NdbRestarter restarter;
76 
77  if (restarter.getNumDbNodes() < 2){
78  ctx->stopTest();
79  return NDBT_OK;
80  }
81 
82  if(restarter.waitClusterStarted(60) != 0){
83  g_err << "Cluster failed to start" << endl;
84  return NDBT_FAILED;
85  }
86 
87  if (testMaster) {
88  if (testSlave) {
89  if (backup.NFMasterAsSlave(restarter) != NDBT_OK){
90  return NDBT_FAILED;
91  }
92  } else {
93  if (backup.NFMaster(restarter) != NDBT_OK){
94  return NDBT_FAILED;
95  }
96  }
97  } else {
98  if (backup.NFSlave(restarter) != NDBT_OK){
99  return NDBT_FAILED;
100  }
101  }
102 
103  return NDBT_OK;
104 }
105 
106 int runFail(NDBT_Context* ctx, NDBT_Step* step){
107  NdbBackup backup(GETNDB(step)->getNodeId()+1);
108 
109  NdbRestarter restarter;
110 
111  if (restarter.getNumDbNodes() < 2){
112  ctx->stopTest();
113  return NDBT_OK;
114  }
115 
116  if(restarter.waitClusterStarted(60) != 0){
117  g_err << "Cluster failed to start" << endl;
118  return NDBT_FAILED;
119  }
120 
121  if (testMaster) {
122  if (testSlave) {
123  if (backup.FailMasterAsSlave(restarter) != NDBT_OK){
124  return NDBT_FAILED;
125  }
126  } else {
127  if (backup.FailMaster(restarter) != NDBT_OK){
128  return NDBT_FAILED;
129  }
130  }
131  } else {
132  if (backup.FailSlave(restarter) != NDBT_OK){
133  return NDBT_FAILED;
134  }
135  }
136 
137  return NDBT_OK;
138 }
139 
140 int runBackupOne(NDBT_Context* ctx, NDBT_Step* step){
141  NdbBackup backup(GETNDB(step)->getNodeId()+1);
142  unsigned backupId = 0;
143 
144  if (backup.start(backupId) == -1){
145  return NDBT_FAILED;
146  }
147  ndbout << "Started backup " << backupId << endl;
148  ctx->setProperty("BackupId", backupId);
149 
150  return NDBT_OK;
151 }
152 
153 int runBackupRandom(NDBT_Context* ctx, NDBT_Step* step){
154  NdbBackup backup(GETNDB(step)->getNodeId()+1);
155  unsigned backupId = rand() % (MAX_BACKUPS);
156 
157  if (backup.start(backupId) == -1){
158  return NDBT_FAILED;
159  }
160  ndbout << "Started backup " << backupId << endl;
161  ctx->setProperty("BackupId", backupId);
162 
163  return NDBT_OK;
164 }
165 
166 int
167 runBackupLoop(NDBT_Context* ctx, NDBT_Step* step){
168  NdbBackup backup(GETNDB(step)->getNodeId()+1);
169 
170  int loops = ctx->getNumLoops();
171  while(!ctx->isTestStopped() && loops--)
172  {
173  if (backup.start() == -1)
174  {
175  sleep(1);
176  loops++;
177  }
178  else
179  {
180  sleep(3);
181  }
182  }
183 
184  ctx->stopTest();
185  return NDBT_OK;
186 }
187 
188 int
189 runDDL(NDBT_Context* ctx, NDBT_Step* step){
190  Ndb* pNdb= GETNDB(step);
191  NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
192 
193  const int tables = NDBT_Tables::getNumTables();
194  while(!ctx->isTestStopped())
195  {
196  const int tab_no = rand() % (tables);
197  NdbDictionary::Table tab = *NDBT_Tables::getTable(tab_no);
198  BaseString name= tab.getName();
199  name.appfmt("-%d", step->getStepNo());
200  tab.setName(name.c_str());
201  if(pDict->createTable(tab) == 0)
202  {
203  HugoTransactions hugoTrans(* pDict->getTable(name.c_str()));
204  if (hugoTrans.loadTable(pNdb, 10000) != 0){
205  return NDBT_FAILED;
206  }
207 
208  while(pDict->dropTable(tab.getName()) != 0 &&
209  pDict->getNdbError().code != 4009)
210  g_err << pDict->getNdbError() << endl;
211 
212  sleep(1);
213 
214  }
215  }
216  return NDBT_OK;
217 }
218 
219 
220 int runDropTablesRestart(NDBT_Context* ctx, NDBT_Step* step){
221  NdbRestarter restarter;
222 
223  if (runDropTable(ctx, step) != 0)
224  return NDBT_FAILED;
225 
226  if (restarter.restartAll(false) != 0)
227  return NDBT_FAILED;
228 
229  if (restarter.waitClusterStarted() != 0)
230  return NDBT_FAILED;
231 
232  return NDBT_OK;
233 }
234 
235 int runRestoreOne(NDBT_Context* ctx, NDBT_Step* step){
236  NdbBackup backup(GETNDB(step)->getNodeId()+1);
237  unsigned backupId = ctx->getProperty("BackupId");
238 
239  ndbout << "Restoring backup " << backupId << endl;
240 
241  if (backup.restore(backupId) == -1){
242  return NDBT_FAILED;
243  }
244 
245  Ndb* pNdb = GETNDB(step);
246  pNdb->getDictionary()->invalidateTable(tabname);
247  const NdbDictionary::Table* tab = pNdb->getDictionary()->getTable(tabname);
248 
249  if (tab)
250  {
251  ctx->setTab(tab);
252  return NDBT_OK;
253  }
254 
255  return NDBT_FAILED;
256 }
257 
258 int runVerifyOne(NDBT_Context* ctx, NDBT_Step* step){
259  int records = ctx->getNumRecords();
260  Ndb* pNdb = GETNDB(step);
261  int result = NDBT_OK;
262  int count = 0;
263 
264  const NdbDictionary::Table* tab = ctx->getTab();
265  if(tab == 0)
266  return NDBT_FAILED;
267 
268  UtilTransactions utilTrans(* tab);
269  HugoTransactions hugoTrans(* tab);
270 
271  do{
272 
273  // Check that there are as many records as we expected
274  CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
275 
276  g_err << "count = " << count;
277  g_err << " records = " << records;
278  g_err << endl;
279 
280  CHECK(count == records);
281 
282  // Read and verify every record
283  CHECK(hugoTrans.pkReadRecords(pNdb, records) == 0);
284 
285  } while (false);
286 
287  return result;
288 }
289 
290 int runClearTable(NDBT_Context* ctx, NDBT_Step* step){
291  int records = ctx->getNumRecords();
292 
293  UtilTransactions utilTrans(*ctx->getTab());
294  if (utilTrans.clearTable2(GETNDB(step), records) != 0){
295  return NDBT_FAILED;
296  }
297  return NDBT_OK;
298 }
299 
300 int runDropTable(NDBT_Context* ctx, NDBT_Step* step)
301 {
302 
303  const NdbDictionary::Table *tab = ctx->getTab();
304  GETNDB(step)->getDictionary()->dropTable(tab->getName());
305 
306  return NDBT_OK;
307 }
308 
309 #include "bank/Bank.hpp"
310 
311 int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
312  Bank bank(ctx->m_cluster_connection);
313  bool overWriteExisting = true;
314  if (bank.createAndLoadBank(overWriteExisting) != NDBT_OK)
315  return NDBT_FAILED;
316  return NDBT_OK;
317 }
318 
319 int runBankTimer(NDBT_Context* ctx, NDBT_Step* step){
320  Bank bank(ctx->m_cluster_connection);
321  int wait = 30; // Max seconds between each "day"
322  int yield = 1; // Loops before bank returns
323 
324  while (ctx->isTestStopped() == false) {
325  bank.performIncreaseTime(wait, yield);
326  }
327  return NDBT_OK;
328 }
329 
330 int runBankTransactions(NDBT_Context* ctx, NDBT_Step* step){
331  Bank bank(ctx->m_cluster_connection);
332  int wait = 10; // Max ms between each transaction
333  int yield = 100; // Loops before bank returns
334 
335  while (ctx->isTestStopped() == false) {
336  bank.performTransactions(wait, yield);
337  }
338  return NDBT_OK;
339 }
340 
341 int runBankGL(NDBT_Context* ctx, NDBT_Step* step){
342  Bank bank(ctx->m_cluster_connection);
343  int yield = 20; // Loops before bank returns
344  int result = NDBT_OK;
345 
346  while (ctx->isTestStopped() == false) {
347  if (bank.performMakeGLs(yield) != NDBT_OK){
348  ndbout << "bank.performMakeGLs FAILED" << endl;
349  result = NDBT_FAILED;
350  }
351  }
352  return NDBT_OK;
353 }
354 
355 int runBankSum(NDBT_Context* ctx, NDBT_Step* step){
356  Bank bank(ctx->m_cluster_connection);
357  int wait = 2000; // Max ms between each sum of accounts
358  int yield = 1; // Loops before bank returns
359  int result = NDBT_OK;
360 
361  while (ctx->isTestStopped() == false) {
362  if (bank.performSumAccounts(wait, yield) != NDBT_OK){
363  ndbout << "bank.performSumAccounts FAILED" << endl;
364  result = NDBT_FAILED;
365  }
366  }
367  return result ;
368 }
369 
370 int runDropBank(NDBT_Context* ctx, NDBT_Step* step){
371  Bank bank(ctx->m_cluster_connection);
372  if (bank.dropBank() != NDBT_OK)
373  return NDBT_FAILED;
374  return NDBT_OK;
375 }
376 
377 int runBackupBank(NDBT_Context* ctx, NDBT_Step* step){
378  int loops = ctx->getNumLoops();
379  int l = 0;
380  int maxSleep = 30; // Max seconds between each backup
381  Ndb* pNdb = GETNDB(step);
382  NdbBackup backup(GETNDB(step)->getNodeId()+1);
383  unsigned minBackupId = ~0;
384  unsigned maxBackupId = 0;
385  unsigned backupId = 0;
386  int result = NDBT_OK;
387 
388  while (l < loops && result != NDBT_FAILED){
389 
390  if (pNdb->waitUntilReady() != 0){
391  result = NDBT_FAILED;
392  continue;
393  }
394 
395  // Sleep for a while
396  NdbSleep_SecSleep(maxSleep);
397 
398  // Perform backup
399  if (backup.start(backupId) != 0){
400  ndbout << "backup.start failed" << endl;
401  result = NDBT_FAILED;
402  continue;
403  }
404  ndbout << "Started backup " << backupId << endl;
405 
406  // Remember min and max backupid
407  if (backupId < minBackupId)
408  minBackupId = backupId;
409 
410  if (backupId > maxBackupId)
411  maxBackupId = backupId;
412 
413  ndbout << " maxBackupId = " << maxBackupId
414  << ", minBackupId = " << minBackupId << endl;
415  ctx->setProperty("MinBackupId", minBackupId);
416  ctx->setProperty("MaxBackupId", maxBackupId);
417 
418  l++;
419  }
420 
421  ctx->stopTest();
422 
423  return result;
424 }
425 
426 int runRestoreBankAndVerify(NDBT_Context* ctx, NDBT_Step* step){
427  NdbRestarter restarter;
428  NdbBackup backup(GETNDB(step)->getNodeId()+1);
429  unsigned minBackupId = ctx->getProperty("MinBackupId");
430  unsigned maxBackupId = ctx->getProperty("MaxBackupId");
431  unsigned backupId = minBackupId;
432  int result = NDBT_OK;
433  int errSumAccounts = 0;
434  int errValidateGL = 0;
435 
436  ndbout << " maxBackupId = " << maxBackupId << endl;
437  ndbout << " minBackupId = " << minBackupId << endl;
438 
439  while (backupId <= maxBackupId){
440 
441  // TEMPORARY FIX
442  // To erase all tables from cache(s)
443  // To be removed, maybe replaced by ndb.invalidate();
444  {
445  Bank bank(ctx->m_cluster_connection);
446 
447  if (bank.dropBank() != NDBT_OK){
448  result = NDBT_FAILED;
449  break;
450  }
451  }
452  // END TEMPORARY FIX
453 
454  ndbout << "Performing restart" << endl;
455  if (restarter.restartAll(false) != 0)
456  return NDBT_FAILED;
457 
458  if (restarter.waitClusterStarted() != 0)
459  return NDBT_FAILED;
460 
461  ndbout << "Dropping " << tabname << endl;
462  NdbDictionary::Dictionary* pDict = GETNDB(step)->getDictionary();
463  pDict->dropTable(tabname);
464 
465  ndbout << "Restoring backup " << backupId << endl;
466  if (backup.restore(backupId) == -1){
467  return NDBT_FAILED;
468  }
469  ndbout << "Backup " << backupId << " restored" << endl;
470 
471  // Let bank verify
472  Bank bank(ctx->m_cluster_connection);
473 
474  int wait = 0;
475  int yield = 1;
476  if (bank.performSumAccounts(wait, yield) != 0){
477  ndbout << "bank.performSumAccounts FAILED" << endl;
478  ndbout << " backupId = " << backupId << endl << endl;
479  result = NDBT_FAILED;
480  errSumAccounts++;
481  }
482 
483  if (bank.performValidateAllGLs() != 0){
484  ndbout << "bank.performValidateAllGLs FAILED" << endl;
485  ndbout << " backupId = " << backupId << endl << endl;
486  result = NDBT_FAILED;
487  errValidateGL++;
488  }
489 
490  backupId++;
491  }
492 
493  if (result != NDBT_OK){
494  ndbout << "Verification of backup failed" << endl
495  << " errValidateGL="<<errValidateGL<<endl
496  << " errSumAccounts="<<errSumAccounts<<endl << endl;
497  }
498 
499  return result;
500 }
501 int runBackupUndoWaitStarted(NDBT_Context* ctx, NDBT_Step* step){
502  NdbBackup backup(GETNDB(step)->getNodeId()+1);
503  unsigned backupId = 0;
504  int undoError = 10041;
505  NdbRestarter restarter;
506 
507  if(restarter.waitClusterStarted(60)){
508  g_err << "waitClusterStarted failed"<< endl;
509  return NDBT_FAILED;
510  }
511 
512  if (restarter.insertErrorInAllNodes(undoError) != 0) {
513  g_err << "Error insert failed" << endl;
514  return NDBT_FAILED;
515  }
516  // start backup wait started
517  if (backup.start(backupId, 1, 0, 1) == -1){
518  return NDBT_FAILED;
519  }
520  ndbout << "Started backup " << backupId << endl;
521  ctx->setProperty("BackupId", backupId);
522 
523  return NDBT_OK;
524 }
525 int runChangeUndoDataDuringBackup(NDBT_Context* ctx, NDBT_Step* step){
526  Ndb* pNdb= GETNDB(step);
527 
528  int records = ctx->getNumRecords();
529  int num = 5;
530  if (records - 5 < 0)
531  num = 1;
532 
533  HugoTransactions hugoTrans(*ctx->getTab());
534 
535  //update all rows
536  if(hugoTrans.pkUpdateRecords(pNdb, records) != 0) {
537  g_err << "Can't update all the records" << endl;
538  return NDBT_FAILED;
539  }
540 
541  //delete first 10 rows
542  if(hugoTrans.pkDelRecords(pNdb, num*2) != 0) {
543  g_err << "Can't delete first 5 rows" << endl;
544  return NDBT_FAILED;
545  }
546 
547  //add 5 new rows at the first(0 ~ 4)
548  NdbTransaction *pTransaction= pNdb->startTransaction();
549  if (pTransaction == NULL) {
550  g_err << "Can't get transaction pointer" << endl;
551  return NDBT_FAILED;
552  }
553  if(hugoTrans.setTransaction(pTransaction) != 0) {
554  g_err << "Set transaction error" << endl;
555  pNdb->closeTransaction(pTransaction);
556  return NDBT_FAILED;
557  }
558  if(hugoTrans.pkInsertRecord(pNdb, 0, num, 2) != 0) {
559  g_err << "pkInsertRecord error" << endl;
560  pNdb->closeTransaction(pTransaction);
561  return NDBT_FAILED;
562  }
563  if(pTransaction->execute(Commit ) != 0) {
564  g_err << "Can't commit transaction delete" << endl;
565  return NDBT_FAILED;
566  }
567  hugoTrans.closeTransaction(pNdb);
568 
569  // make sure backup have finish
570  NdbBackup backup(GETNDB(step)->getNodeId()+1);
571 
572  // start log event
573  if(backup.startLogEvent() != 0) {
574  g_err << "Can't create log event" << endl;
575  return NDBT_FAILED;
576  }
577  NdbSleep_SecSleep(15);
578  int i = 0;
579  while (1) {
580  if (backup.checkBackupStatus() == 2) //complete
581  break;
582  else if (i == 15) {
583  g_err << "Backup timeout" << endl;
584  return NDBT_FAILED;
585  } else
586  NdbSleep_SecSleep(2);
587  i++;
588  }
589 
590  return NDBT_OK;
591 }
592 
593 int runVerifyUndoData(NDBT_Context* ctx, NDBT_Step* step){
594  int records = ctx->getNumRecords();
595  Ndb* pNdb = GETNDB(step);
596  int count = 0;
597  int num = 5;
598  if (records - 5 < 0)
599  num = 1;
600 
601  const NdbDictionary::Table* tab =
602  GETNDB(step)->getDictionary()->getTable(ctx->getTab()->getName());
603 
604  if(tab == 0) {
605  g_err << " Can't find table" << endl;
606  return NDBT_FAILED;
607  }
608 
609  UtilTransactions utilTrans(* tab);
610  HugoTransactions hugoTrans(* tab);
611 
612  // Check that there are as many records as we expected
613  if(utilTrans.selectCount(pNdb, 64, &count) != 0) {
614  g_err << "Can't get records count" << endl;
615  return NDBT_FAILED;
616  }
617 
618  g_err << "count = " << count;
619  g_err << " records = " << records;
620  g_err << endl;
621 
622  if (count != records) {
623  g_err << "The records count is not correct" << endl;
624  return NDBT_FAILED;
625  }
626 
627  // make sure all the update data is there
628  NdbTransaction *pTransaction= pNdb->startTransaction();
629  if (pTransaction == NULL) {
630  g_err << "Can't get transaction pointer" << endl;
631  return NDBT_FAILED;
632  }
633  if(hugoTrans.setTransaction(pTransaction) != 0) {
634  g_err << "Set transaction error" << endl;
635  pNdb->closeTransaction(pTransaction);
636  return NDBT_FAILED;
637  }
638  if(hugoTrans.pkReadRecord(pNdb, 0, records, NdbOperation::LM_Read) != 0) {
639  g_err << "Can't read record" << endl;
640  return NDBT_FAILED;
641  }
642  if(hugoTrans.verifyUpdatesValue(0, records) != 0) {
643  g_err << "The records restored with undo log is not correct" << endl;
644  return NDBT_FAILED;
645  }
646  hugoTrans.closeTransaction(pNdb);
647 
648  return NDBT_OK;
649 }
650 
651 int
652 runBug57650(NDBT_Context* ctx, NDBT_Step* step)
653 {
654  NdbBackup backup(GETNDB(step)->getNodeId()+1);
655  NdbRestarter res;
656 
657  int node0 = res.getNode(NdbRestarter::NS_RANDOM);
658  res.insertErrorInNode(node0, 5057);
659 
660  unsigned backupId = 0;
661  if (backup.start(backupId) == -1)
662  return NDBT_FAILED;
663 
664  return NDBT_OK;
665 }
666 
667 NDBT_TESTSUITE(testBackup);
668 TESTCASE("BackupOne",
669  "Test that backup and restore works on one table \n"
670  "1. Load table\n"
671  "2. Backup\n"
672  "3. Drop tables and restart \n"
673  "4. Restore\n"
674  "5. Verify count and content of table\n"){
675  INITIALIZER(clearOldBackups);
676  INITIALIZER(runLoadTable);
677  INITIALIZER(runBackupOne);
678  INITIALIZER(runDropTablesRestart);
679  INITIALIZER(runRestoreOne);
680  VERIFIER(runVerifyOne);
681  FINALIZER(runClearTable);
682 }
683 TESTCASE("BackupRandom",
684  "Test that backup n and restore works on one table \n"
685  "1. Load table\n"
686  "2. Backup\n"
687  "3. Drop tables and restart \n"
688  "4. Restore\n"
689  "5. Verify count and content of table\n"){
690  INITIALIZER(clearOldBackups);
691  INITIALIZER(runLoadTable);
692  INITIALIZER(runBackupRandom);
693  INITIALIZER(runDropTablesRestart);
694  INITIALIZER(runRestoreOne);
695  VERIFIER(runVerifyOne);
696  FINALIZER(runClearTable);
697 }
698 TESTCASE("BackupDDL",
699  "Test that backup and restore works on with DDL ongoing\n"
700  "1. Backups and DDL (create,drop,table.index)"){
701  INITIALIZER(clearOldBackups);
702  INITIALIZER(runLoadTable);
703  STEP(runBackupLoop);
704  STEP(runDDL);
705  STEP(runDDL);
706  FINALIZER(runClearTable);
707 }
708 TESTCASE("BackupBank",
709  "Test that backup and restore works during transaction load\n"
710  " by backing up the bank"
711  "1. Create bank\n"
712  "2a. Start bank and let it run\n"
713  "2b. Perform loop number of backups of the bank\n"
714  " when backups are finished tell bank to close\n"
715  "3. Restart ndb -i and reload each backup\n"
716  " let bank verify that the backup is consistent\n"
717  "4. Drop bank\n"){
718  INITIALIZER(clearOldBackups);
719  INITIALIZER(runCreateBank);
720  STEP(runBankTimer);
721  STEP(runBankTransactions);
722  STEP(runBankTransactions);
723  STEP(runBankTransactions);
724  STEP(runBankTransactions);
725  STEP(runBankTransactions);
726  STEP(runBankTransactions);
727  STEP(runBankTransactions);
728  STEP(runBankTransactions);
729  STEP(runBankTransactions);
730  STEP(runBankTransactions);
731  STEP(runBankGL);
732  // TODO STEP(runBankSum);
733  STEP(runBackupBank);
734  VERIFIER(runRestoreBankAndVerify);
735  FINALIZER(runDropBank);
736 }
737 TESTCASE("BackupUndoLog",
738  "Test for backup happen at start time\n"
739  "1. Load table\n"
740  "2. Start backup with wait started\n"
741  "3. Insert, delete, update data during backup\n"
742  "4. Drop tables and restart \n"
743  "5. Restore\n"
744  "6. Verify records of table\n"
745  "7. Clear tables\n"){
746  INITIALIZER(runLoadTable);
747  INITIALIZER(runBackupUndoWaitStarted);
748  INITIALIZER(runChangeUndoDataDuringBackup);
749  INITIALIZER(runDropTablesRestart);
750  INITIALIZER(runRestoreOne);
751  VERIFIER(runVerifyUndoData);
752  FINALIZER(runClearTable);
753 }
754 TESTCASE("NFMaster",
755  "Test that backup behaves during node failiure\n"){
756  INITIALIZER(clearOldBackups);
757  INITIALIZER(setMaster);
758  STEP(runAbort);
759 
760 }
761 TESTCASE("NFMasterAsSlave",
762  "Test that backup behaves during node failiure\n"){
763  INITIALIZER(clearOldBackups);
764  INITIALIZER(setMasterAsSlave);
765  STEP(runAbort);
766 
767 }
768 TESTCASE("NFSlave",
769  "Test that backup behaves during node failiure\n"){
770  INITIALIZER(clearOldBackups);
771  INITIALIZER(setSlave);
772  STEP(runAbort);
773 
774 }
775 TESTCASE("FailMaster",
776  "Test that backup behaves during node failiure\n"){
777  INITIALIZER(clearOldBackups);
778  INITIALIZER(setMaster);
779  STEP(runFail);
780 
781 }
782 TESTCASE("FailMasterAsSlave",
783  "Test that backup behaves during node failiure\n"){
784  INITIALIZER(clearOldBackups);
785  INITIALIZER(setMasterAsSlave);
786  STEP(runFail);
787 
788 }
789 TESTCASE("FailSlave",
790  "Test that backup behaves during node failiure\n"){
791  INITIALIZER(clearOldBackups);
792  INITIALIZER(setSlave);
793  STEP(runFail);
794 
795 }
796 TESTCASE("Bug57650", "")
797 {
798  INITIALIZER(runBug57650);
799 }
800 NDBT_TESTSUITE_END(testBackup);
801 
802 int main(int argc, const char** argv){
803  ndb_init();
804  NDBT_TESTSUITE_INSTANCE(testBackup);
805  return testBackup.execute(argc, argv);
806 }
807 
808