diff options
author | unknown <joreland@mysql.com> | 2005-07-20 11:48:48 +0200 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2005-07-20 11:48:48 +0200 |
commit | 783dbfc3a8151a5fc25d8d8001e4b99575bbb24d (patch) | |
tree | a30a3b5ee7c3a753c8fdc2bacc1fc0e0fc8a16a5 /ndb/test/ndbapi | |
parent | 6913d8058e0eee498c1dfaf9372c7441c05b665a (diff) | |
download | mariadb-git-783dbfc3a8151a5fc25d8d8001e4b99575bbb24d.tar.gz |
bug#11942
ndb/include/kernel/signaldata/AlterTable.hpp:
Add error code for backup in progress
ndb/include/kernel/signaldata/DictTabInfo.hpp:
Add backup state
ndb/include/kernel/signaldata/DropTable.hpp:
Add error code for backup in progress
ndb/include/ndbapi/NdbDictionary.hpp:
Add backup state
ndb/src/kernel/blocks/backup/Backup.cpp:
1) remove invalid require (util_sequence_ref) crash
2) Don't backup objects dropping/creating
3) set correct error code on backup fragment ref (crash)
4) save TrigAttrInfo header when getting log full (crash)
5) lock/unlock tables during backup
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
1) add mutex lock/unlock as part of drop/alter table
2) add lock/unlock for backup
3) remove TC from backup trigger loop
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Add BACKUP_ONGOING state
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Add backup state
ndb/src/ndbapi/ndberror.c:
Add error code for backup in progress
ndb/test/ndbapi/testBackup.cpp:
Add testcase for testBackup -n BackupDDL
ndb/tools/drop_index.cpp:
Fix ndb_drop_index
ndb/tools/listTables.cpp:
Print of backup state
Diffstat (limited to 'ndb/test/ndbapi')
-rw-r--r-- | ndb/test/ndbapi/testBackup.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/ndb/test/ndbapi/testBackup.cpp b/ndb/test/ndbapi/testBackup.cpp index bea5d5307e2..14198c250c7 100644 --- a/ndb/test/ndbapi/testBackup.cpp +++ b/ndb/test/ndbapi/testBackup.cpp @@ -138,6 +138,61 @@ int runBackupOne(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +int +runBackupLoop(NDBT_Context* ctx, NDBT_Step* step){ + NdbBackup backup(GETNDB(step)->getNodeId()+1); + unsigned backupId = 0; + + int loops = ctx->getNumLoops(); + while(!ctx->isTestStopped() && loops--) + { + if (backup.start(backupId) == -1) + { + sleep(1); + loops++; + } + else + { + sleep(3); + } + } + + ctx->stopTest(); + return NDBT_OK; +} + +int +runDDL(NDBT_Context* ctx, NDBT_Step* step){ + Ndb* pNdb= GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + const int tables = NDBT_Tables::getNumTables(); + while(!ctx->isTestStopped()) + { + const int tab_no = rand() % (tables); + NdbDictionary::Table tab = *NDBT_Tables::getTable(tab_no); + BaseString name= tab.getName(); + name.appfmt("-%d", step->getStepNo()); + tab.setName(name.c_str()); + if(pDict->createTable(tab) == 0) + { + HugoTransactions hugoTrans(* pDict->getTable(name.c_str())); + if (hugoTrans.loadTable(pNdb, 10000) != 0){ + return NDBT_FAILED; + } + + while(pDict->dropTable(tab.getName()) != 0 && + pDict->getNdbError().code != 4009) + g_err << pDict->getNdbError() << endl; + + sleep(1); + + } + } + return NDBT_OK; +} + + int runRestartInitial(NDBT_Context* ctx, NDBT_Step* step){ NdbRestarter restarter; @@ -417,6 +472,15 @@ TESTCASE("BackupOne", VERIFIER(runVerifyOne); FINALIZER(runClearTable); } +TESTCASE("BackupDDL", + "Test that backup and restore works on with DDL ongoing\n" + "1. Backups and DDL (create,drop,table.index)"){ + INITIALIZER(runLoadTable); + STEP(runBackupLoop); + STEP(runDDL); + STEP(runDDL); + FINALIZER(runClearTable); +} TESTCASE("BackupBank", "Test that backup and restore works during transaction load\n" " by backing up the bank" |