mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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
This commit is contained in:
@ -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"
|
||||
|
Reference in New Issue
Block a user