diff options
author | unknown <jimw@mysql.com> | 2005-08-31 15:24:06 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-08-31 15:24:06 -0700 |
commit | bdddd8c089c05ac8e74ab4996c601175d52a5dc8 (patch) | |
tree | 63161ccb51465f90409872099f902b79a9d23837 /ndb/src/kernel | |
parent | c6b54efea2f564d7a4d9fda7bc79f2601395250a (diff) | |
parent | 92e2b9edb1660a2f9d7dcd7543fc5140abd3ff0d (diff) | |
download | mariadb-git-bdddd8c089c05ac8e74ab4996c601175d52a5dc8.tar.gz |
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
mysql-test/t/system_mysql_db_fix.test:
Auto merged
ndb/src/kernel/blocks/backup/BackupInit.cpp:
Auto merged
ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
Auto merged
ndb/src/kernel/blocks/dbacc/DbaccInit.cpp:
Auto merged
ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Auto merged
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Auto merged
ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
Auto merged
ndb/src/kernel/blocks/dblqh/DblqhInit.cpp:
Auto merged
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
Auto merged
ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
Auto merged
ndb/src/kernel/blocks/dbtup/DbtupGen.cpp:
Auto merged
ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
Auto merged
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
Auto merged
ndb/src/kernel/vm/SimulatedBlock.cpp:
Auto merged
ndb/src/kernel/vm/SimulatedBlock.hpp:
Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
sql/item_sum.cc:
Auto merged
sql/sql_table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
ndb/src/ndbapi/ndberror.c:
Resolve conflicts
sql/ha_innodb.cc:
Resolve conflicts
sql/item_strfunc.cc:
Resolve conflicts
Diffstat (limited to 'ndb/src/kernel')
23 files changed, 268 insertions, 398 deletions
diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index eae72f43db5..2c36896e34c 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -150,16 +150,16 @@ Backup::Backup(const Configuration & conf) : addRecSignal(GSN_DI_FCOUNTCONF, &Backup::execDI_FCOUNTCONF); addRecSignal(GSN_DIGETPRIMCONF, &Backup::execDIGETPRIMCONF); - addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF); + addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF, true); addRecSignal(GSN_FSOPENCONF, &Backup::execFSOPENCONF); - addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF); + addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF, true); addRecSignal(GSN_FSCLOSECONF, &Backup::execFSCLOSECONF); - addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF); + addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF, true); addRecSignal(GSN_FSAPPENDCONF, &Backup::execFSAPPENDCONF); - addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF); + addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF, true); addRecSignal(GSN_FSREMOVECONF, &Backup::execFSREMOVECONF); /*****/ diff --git a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp index 8800388e96c..1da6c56b0e3 100644 --- a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp +++ b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp @@ -905,17 +905,12 @@ private: void execACC_TO_REQ(Signal* signal); void execACC_LOCKREQ(Signal* signal); void execFSOPENCONF(Signal* signal); - void execFSOPENREF(Signal* signal); void execFSCLOSECONF(Signal* signal); - void execFSCLOSEREF(Signal* signal); void execFSWRITECONF(Signal* signal); - void execFSWRITEREF(Signal* signal); void execFSREADCONF(Signal* signal); - void execFSREADREF(Signal* signal); void execNDB_STTOR(Signal* signal); void execDROP_TAB_REQ(Signal* signal); void execFSREMOVECONF(Signal* signal); - void execFSREMOVEREF(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); void execSET_VAR_REQ(Signal* signal); void execDUMP_STATE_ORD(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp index d4ff20e4c43..d03f3b55d6a 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp @@ -188,17 +188,12 @@ Dbacc::Dbacc(const class Configuration & conf): addRecSignal(GSN_ACC_TO_REQ, &Dbacc::execACC_TO_REQ); addRecSignal(GSN_ACC_LOCKREQ, &Dbacc::execACC_LOCKREQ); addRecSignal(GSN_FSOPENCONF, &Dbacc::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dbacc::execFSOPENREF); addRecSignal(GSN_FSCLOSECONF, &Dbacc::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dbacc::execFSCLOSEREF); addRecSignal(GSN_FSWRITECONF, &Dbacc::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dbacc::execFSWRITEREF); addRecSignal(GSN_FSREADCONF, &Dbacc::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dbacc::execFSREADREF); addRecSignal(GSN_NDB_STTOR, &Dbacc::execNDB_STTOR); addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ); addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF); - addRecSignal(GSN_FSREMOVEREF, &Dbacc::execFSREMOVEREF); addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true); addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ); diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 37b6825cbd2..f4b084c42fb 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -251,15 +251,6 @@ void Dbacc::execFSCLOSECONF(Signal* signal) return; }//Dbacc::execFSCLOSECONF() -/* ******************--------------------------------------------------------------- */ -/* FSCLOSEREF OPENFILE CONF */ -/* ******************------------------------------+ */ -/* SENDER: FS, LEVEL B */ -void Dbacc::execFSCLOSEREF(Signal* signal) -{ - jamEntry(); - ndbrequire(false); -}//Dbacc::execFSCLOSEREF() /* ******************--------------------------------------------------------------- */ /* FSOPENCONF OPENFILE CONF */ @@ -307,15 +298,6 @@ void Dbacc::execFSOPENCONF(Signal* signal) return; }//Dbacc::execFSOPENCONF() -/* ******************--------------------------------------------------------------- */ -/* FSOPENREF OPENFILE REF */ -/* ******************------------------------------+ */ -/* SENDER: FS, LEVEL B */ -void Dbacc::execFSOPENREF(Signal* signal) -{ - jamEntry(); - ndbrequire(false); -}//Dbacc::execFSOPENREF() /* ******************--------------------------------------------------------------- */ /* FSREADCONF OPENFILE CONF */ @@ -369,16 +351,6 @@ void Dbacc::execFSREADCONF(Signal* signal) return; }//Dbacc::execFSREADCONF() -/* ******************--------------------------------------------------------------- */ -/* FSREADRREF OPENFILE CONF */ -/* ******************------------------------------+ */ -/* SENDER: FS, LEVEL B */ -void Dbacc::execFSREADREF(Signal* signal) -{ - jamEntry(); - progError(0, __LINE__, "Read of file refused"); - return; -}//Dbacc::execFSREADREF() /* ******************--------------------------------------------------------------- */ /* FSWRITECONF OPENFILE CONF */ @@ -482,16 +454,6 @@ void Dbacc::execFSWRITECONF(Signal* signal) return; }//Dbacc::execFSWRITECONF() -/* ******************--------------------------------------------------------------- */ -/* FSWRITEREF OPENFILE CONF */ -/* ******************------------------------------+ */ -/* SENDER: FS, LEVEL B */ -void Dbacc::execFSWRITEREF(Signal* signal) -{ - jamEntry(); - progError(0, __LINE__, "Write to file refused"); - return; -}//Dbacc::execFSWRITEREF() /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ @@ -1436,10 +1398,6 @@ void Dbacc::execFSREMOVECONF(Signal* signal) tabPtr.p->tabUserRef = 0; }//Dbacc::execFSREMOVECONF() -void Dbacc::execFSREMOVEREF(Signal* signal) -{ - ndbrequire(false); -}//Dbacc::execFSREMOVEREF() /* -------------------------------------------------------------------------- */ /* ADDFRAGTOTAB */ diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 6116502ab12..05c5d5d5198 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -400,14 +400,6 @@ void Dbdict::execFSCLOSECONF(Signal* signal) }//switch }//execFSCLOSECONF() -/* ---------------------------------------------------------------- */ -// A close file was refused. -/* ---------------------------------------------------------------- */ -void Dbdict::execFSCLOSEREF(Signal* signal) -{ - jamEntry(); - progError(0, 0); -}//execFSCLOSEREF() /* ---------------------------------------------------------------- */ // A file was successfully opened. @@ -470,17 +462,21 @@ void Dbdict::execFSOPENREF(Signal* signal) c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer); switch (fsPtr.p->fsState) { case FsConnectRecord::OPEN_READ_SCHEMA1: + jam(); openReadSchemaRef(signal, fsPtr); - break; + return; case FsConnectRecord::OPEN_READ_TAB_FILE1: jam(); openReadTableRef(signal, fsPtr); - break; + return; default: - jamLine((fsPtr.p->fsState & 0xFFF)); - ndbrequire(false); break; }//switch + { + char msg[100]; + sprintf(msg, "File system open failed during FsConnectRecord state %d", (Uint32)fsPtr.p->fsState); + fsRefError(signal,__LINE__,msg); + } }//execFSOPENREF() /* ---------------------------------------------------------------- */ @@ -520,17 +516,21 @@ void Dbdict::execFSREADREF(Signal* signal) c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer); switch (fsPtr.p->fsState) { case FsConnectRecord::READ_SCHEMA1: + jam(); readSchemaRef(signal, fsPtr); - break; + return; case FsConnectRecord::READ_TAB_FILE1: jam(); readTableRef(signal, fsPtr); - break; + return; default: - jamLine((fsPtr.p->fsState & 0xFFF)); - ndbrequire(false); break; }//switch + { + char msg[100]; + sprintf(msg, "File system read failed during FsConnectRecord state %d", (Uint32)fsPtr.p->fsState); + fsRefError(signal,__LINE__,msg); + } }//execFSREADREF() /* ---------------------------------------------------------------- */ @@ -557,14 +557,6 @@ void Dbdict::execFSWRITECONF(Signal* signal) }//switch }//execFSWRITECONF() -/* ---------------------------------------------------------------- */ -// A write file was refused. -/* ---------------------------------------------------------------- */ -void Dbdict::execFSWRITEREF(Signal* signal) -{ - jamEntry(); - progError(0, 0); -}//execFSWRITEREF() /* ---------------------------------------------------------------- */ // Routines to handle Read/Write of Table Files @@ -1327,13 +1319,11 @@ Dbdict::Dbdict(const class Configuration & conf): addRecSignal(GSN_DICTSTARTREQ, &Dbdict::execDICTSTARTREQ); addRecSignal(GSN_READ_NODESCONF, &Dbdict::execREAD_NODESCONF); addRecSignal(GSN_FSOPENCONF, &Dbdict::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dbdict::execFSOPENREF); + addRecSignal(GSN_FSOPENREF, &Dbdict::execFSOPENREF, true); addRecSignal(GSN_FSCLOSECONF, &Dbdict::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dbdict::execFSCLOSEREF); addRecSignal(GSN_FSWRITECONF, &Dbdict::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dbdict::execFSWRITEREF); addRecSignal(GSN_FSREADCONF, &Dbdict::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dbdict::execFSREADREF); + addRecSignal(GSN_FSREADREF, &Dbdict::execFSREADREF, true); addRecSignal(GSN_LQHFRAGCONF, &Dbdict::execLQHFRAGCONF); addRecSignal(GSN_LQHADDATTCONF, &Dbdict::execLQHADDATTCONF); addRecSignal(GSN_LQHADDATTREF, &Dbdict::execLQHADDATTREF); diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 979cab7717a..6b78fb86534 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -467,13 +467,11 @@ private: void execSCHEMA_INFOCONF(Signal* signal); void execREAD_NODESCONF(Signal* signal); void execFSCLOSECONF(Signal* signal); - void execFSCLOSEREF(Signal* signal); void execFSOPENCONF(Signal* signal); void execFSOPENREF(Signal* signal); void execFSREADCONF(Signal* signal); void execFSREADREF(Signal* signal); void execFSWRITECONF(Signal* signal); - void execFSWRITEREF(Signal* signal); void execNDB_STTOR(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); void execSTTOR(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index 9a5efebc56e..1c14163fe76 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -206,13 +206,13 @@ Dbdih::Dbdih(const class Configuration & config): addRecSignal(GSN_ADD_FRAGCONF, &Dbdih::execADD_FRAGCONF); addRecSignal(GSN_ADD_FRAGREF, &Dbdih::execADD_FRAGREF); addRecSignal(GSN_FSOPENCONF, &Dbdih::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dbdih::execFSOPENREF); + addRecSignal(GSN_FSOPENREF, &Dbdih::execFSOPENREF, true); addRecSignal(GSN_FSCLOSECONF, &Dbdih::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dbdih::execFSCLOSEREF); + addRecSignal(GSN_FSCLOSEREF, &Dbdih::execFSCLOSEREF, true); addRecSignal(GSN_FSREADCONF, &Dbdih::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF); + addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF, true); addRecSignal(GSN_FSWRITECONF, &Dbdih::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF); + addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF, true); addRecSignal(GSN_SET_VAR_REQ, &Dbdih::execSET_VAR_REQ); addRecSignal(GSN_START_INFOREQ, diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 6076246ed1a..55353dca0b5 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -782,29 +782,36 @@ void Dbdih::execFSCLOSEREF(Signal* signal) filePtr.p->reqStatus = FileRecord::IDLE; switch (status) { case FileRecord::CLOSING_GCP: - ndbrequire(false); + jam(); break; case FileRecord::CLOSING_GCP_CRASH: jam(); closingGcpCrashLab(signal, filePtr); - break; + return; case FileRecord::CLOSING_TABLE_CRASH: jam(); closingTableCrashLab(signal, filePtr); - break; + return; case FileRecord::CLOSING_TABLE_SR: - ndbrequire(false); + jam(); break; case FileRecord::TABLE_CLOSE: - ndbrequire(false); + jam(); break; case FileRecord::TABLE_CLOSE_DELETE: - ndbrequire(false); + jam(); break; default: - ndbrequire(false); + jam(); break; + }//switch + { + char msg[100]; + sprintf(msg, "File system close failed during FileRecord status %d", (Uint32)status); + fsRefError(signal,__LINE__,msg); + } + return; }//Dbdih::execFSCLOSEREF() @@ -868,34 +875,39 @@ void Dbdih::execFSOPENREF(Signal* signal) /* WE DID NOT MANAGE TO CREATE A GLOBAL CHECKPOINT FILE. SERIOUS ERROR */ /* WHICH CAUSES A SYSTEM RESTART. */ /* --------------------------------------------------------------------- */ - ndbrequire(false); + jam(); break; case FileRecord::OPENING_COPY_GCI: jam(); openingCopyGciErrorLab(signal, filePtr); - break; + return; case FileRecord::CREATING_COPY_GCI: - ndbrequire(false); + jam(); break; case FileRecord::OPENING_GCP: jam(); openingGcpErrorLab(signal, filePtr); - break; + return; case FileRecord::OPENING_TABLE: jam(); openingTableErrorLab(signal, filePtr); - break; + return; case FileRecord::TABLE_CREATE: - ndbrequire(false); + jam(); break; case FileRecord::TABLE_OPEN_FOR_DELETE: jam(); tableDeleteLab(signal, filePtr); - break; + return; default: - ndbrequire(false); + jam(); break; }//switch + { + char msg[100]; + sprintf(msg, "File system open failed during FileRecord status %d", (Uint32)status); + fsRefError(signal,__LINE__,msg); + } return; }//Dbdih::execFSOPENREF() @@ -935,16 +947,19 @@ void Dbdih::execFSREADREF(Signal* signal) case FileRecord::READING_GCP: jam(); readingGcpErrorLab(signal, filePtr); - break; + return; case FileRecord::READING_TABLE: jam(); readingTableErrorLab(signal, filePtr); - break; + return; default: - ndbrequire(false); break; }//switch - return; + { + char msg[100]; + sprintf(msg, "File system read failed during FileRecord status %d", (Uint32)status); + fsRefError(signal,__LINE__,msg); + } }//Dbdih::execFSREADREF() void Dbdih::execFSWRITECONF(Signal* signal) @@ -989,22 +1004,27 @@ void Dbdih::execFSWRITEREF(Signal* signal) /* EVEN CREATING THE FILE DID NOT WORK. WE WILL THEN CRASH. */ /* ERROR IN WRITING FILE. WE WILL NOT CONTINUE FROM HERE. */ /* --------------------------------------------------------------------- */ - ndbrequire(false); + jam(); break; case FileRecord::WRITE_INIT_GCP: /* --------------------------------------------------------------------- */ /* AN ERROR OCCURRED IN WRITING A GCI FILE WHICH IS A SERIOUS ERROR */ /* THAT CAUSE A SYSTEM RESTART. */ /* --------------------------------------------------------------------- */ - ndbrequire(false); + jam(); break; case FileRecord::TABLE_WRITE: - ndbrequire(false); + jam(); break; default: - ndbrequire(false); + jam(); break; }//switch + { + char msg[100]; + sprintf(msg, "File system write failed during FileRecord status %d", (Uint32)status); + fsRefError(signal,__LINE__,msg); + } return; }//Dbdih::execFSWRITEREF() diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am index d6ad380b806..3b5ae716a63 100644 --- a/ndb/src/kernel/blocks/dbdih/Makefile.am +++ b/ndb/src/kernel/blocks/dbdih/Makefile.am @@ -1,10 +1,16 @@ noinst_LIBRARIES = libdbdih.a +EXTRA_PROGRAMS = ndbd_sysfile_reader libdbdih_a_SOURCES = DbdihInit.cpp DbdihMain.cpp +ndbd_sysfile_reader_SOURCES = printSysfile/printSysfile.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_kernel.mk.am +LDADD += \ + $(top_builddir)/ndb/src/common/util/libgeneral.la \ + $(top_builddir)/ndb/src/common/portlib/libportlib.la + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index ce84834e808..65d7df9ff7d 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -2178,9 +2178,7 @@ private: void execTUP_SRREF(Signal* signal); void execGCP_SAVEREQ(Signal* signal); void execFSOPENCONF(Signal* signal); - void execFSOPENREF(Signal* signal); void execFSCLOSECONF(Signal* signal); - void execFSCLOSEREF(Signal* signal); void execFSWRITECONF(Signal* signal); void execFSWRITEREF(Signal* signal); void execFSREADCONF(Signal* signal); @@ -2189,7 +2187,6 @@ private: void execSET_VAR_REQ(Signal* signal); void execTIME_SIGNAL(Signal* signal); void execFSSYNCCONF(Signal* signal); - void execFSSYNCREF(Signal* signal); void execALTER_TAB_REQ(Signal* signal); void execALTER_TAB_CONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index e39d0ca68a6..04400f75255 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -309,18 +309,15 @@ Dblqh::Dblqh(const class Configuration & conf): addRecSignal(GSN_TUP_SRREF, &Dblqh::execTUP_SRREF); addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ); addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dblqh::execFSOPENREF); addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dblqh::execFSCLOSEREF); addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF); + addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF, true); addRecSignal(GSN_FSREADCONF, &Dblqh::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF); + addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF, true); addRecSignal(GSN_ACC_ABORTCONF, &Dblqh::execACC_ABORTCONF); addRecSignal(GSN_SET_VAR_REQ, &Dblqh::execSET_VAR_REQ); addRecSignal(GSN_TIME_SIGNAL, &Dblqh::execTIME_SIGNAL); addRecSignal(GSN_FSSYNCCONF, &Dblqh::execFSSYNCCONF); - addRecSignal(GSN_FSSYNCREF, &Dblqh::execFSSYNCREF); addRecSignal(GSN_REMOVE_MARKER_ORD, &Dblqh::execREMOVE_MARKER_ORD); //addRecSignal(GSN_DROP_TAB_REQ, &Dblqh::execDROP_TAB_REQ); diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 71b5aaf4163..5cf267a0632 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -11765,14 +11765,6 @@ Dblqh::execFSSYNCCONF(Signal* signal) ccurrentGcprec = RNIL; }//Dblqh::execFSSYNCCONF() -void -Dblqh::execFSSYNCREF(Signal* signal) -{ - jamEntry(); - systemErrorLab(signal); - return; -}//Dblqh::execFSSYNCREF() - /* ######################################################################### */ /* ####### FILE HANDLING MODULE ####### */ @@ -11843,16 +11835,6 @@ void Dblqh::execFSCLOSECONF(Signal* signal) }//switch }//Dblqh::execFSCLOSECONF() -/* ************>> */ -/* FSCLOSEREF > */ -/* ************>> */ -void Dblqh::execFSCLOSEREF(Signal* signal) -{ - jamEntry(); - terrorCode = signal->theData[1]; - systemErrorLab(signal); - return; -}//Dblqh::execFSCLOSEREF() /* ************>> */ /* FSOPENCONF > */ @@ -11941,16 +11923,6 @@ void Dblqh::execFSOPENCONF(Signal* signal) }//switch }//Dblqh::execFSOPENCONF() -/* ************> */ -/* FSOPENREF > */ -/* ************> */ -void Dblqh::execFSOPENREF(Signal* signal) -{ - jamEntry(); - terrorCode = signal->theData[1]; - systemErrorLab(signal); - return; -}//Dblqh::execFSOPENREF() /* ************>> */ /* FSREADCONF > */ @@ -12028,60 +12000,43 @@ void Dblqh::execFSREADREF(Signal* signal) jamEntry(); lfoPtr.i = signal->theData[0]; ptrCheckGuard(lfoPtr, clfoFileSize, logFileOperationRecord); - terrorCode = signal->theData[1]; switch (lfoPtr.p->lfoState) { case LogFileOperationRecord::READ_SR_LAST_MBYTE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_FRONTPAGE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_LAST_FILE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_NEXT_FILE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_EXEC_SR: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_EXEC_LOG: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_FOURTH_PHASE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_FOURTH_ZERO: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_INVALIDATE_PAGES: jam() - systemErrorLab(signal); - return; break; default: jam(); - systemErrorLab(signal); - return; break; }//switch - return; + { + char msg[100]; + sprintf(msg, "File system read failed during LogFileOperationRecord state %d", (Uint32)lfoPtr.p->lfoState); + fsRefError(signal,__LINE__,msg); + } }//Dblqh::execFSREADREF() /* *************** */ @@ -12162,49 +12117,43 @@ void Dblqh::execFSWRITEREF(Signal* signal) switch (lfoPtr.p->lfoState) { case LogFileOperationRecord::WRITE_PAGE_ZERO: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::LAST_WRITE_IN_FILE: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::INIT_WRITE_AT_END: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::INIT_FIRST_PAGE: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::WRITE_GCI_ZERO: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::WRITE_DIRTY: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::WRITE_INIT_MBYTE: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::ACTIVE_WRITE_LOG: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::FIRST_PAGE_WRITE_IN_LOGFILE: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES: jam(); systemErrorLab(signal); - break; default: jam(); - systemErrorLab(signal); break; }//switch + { + char msg[100]; + sprintf(msg, "File system write failed during LogFileOperationRecord state %d", (Uint32)lfoPtr.p->lfoState); + fsRefError(signal,__LINE__,msg); + } }//Dblqh::execFSWRITEREF() diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp index 63c271d6b80..ba6d65ca838 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp @@ -239,6 +239,17 @@ bool PageHeader::check() { return true; } +bool PageHeader::lastPage() +{ + return m_next_page == 0xffffff00; +} + +Uint32 PageHeader::lastWord() +{ + return m_current_page_index; +} + + NdbOut& operator<<(NdbOut& no, const PageHeader& ph) { no << "------------PAGE HEADER------------------------" << endl << endl; ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex"); diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp index 27f2399abbe..11b8dc4a6fa 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp @@ -132,6 +132,8 @@ class PageHeader { public: bool check(); Uint32 getLogRecordSize(); + bool lastPage(); + Uint32 lastWord(); protected: Uint32 m_checksum; Uint32 m_lap; diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp index cea05aebc64..aa8b1d25e4e 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp @@ -35,7 +35,6 @@ #define FROM_BEGINNING 0 void usage(const char * prg); -Uint32 readRecordOverPageBoundary (Uint32 *, Uint32 , Uint32 , Uint32); Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords); void readArguments(int argc, const char** argv); void doExit(); @@ -54,8 +53,8 @@ Uint32 startAtPageIndex = 0; Uint32 *redoLogPage; NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read a redo log file", 16384) { - Uint32 pageIndex = 0; - Uint32 oldPageIndex = 0; + int wordIndex = 0; + int oldWordIndex = 0; Uint32 recordType = 1234567890; PageHeader *thePageHeader; @@ -83,48 +82,47 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read } redoLogPage = new Uint32[PAGESIZE*NO_PAGES_IN_MBYTE]; + Uint32 words_from_previous_page = 0; // Loop for every mbyte. - for (Uint32 j = startAtMbyte; j < NO_MBYTE_IN_FILE; j++) { + bool lastPage = false; + for (Uint32 j = startAtMbyte; j < NO_MBYTE_IN_FILE && !lastPage; j++) { + readFromFile(f, redoLogPage, PAGESIZE*NO_PAGES_IN_MBYTE); - - if (firstLap) { - pageIndex = startAtPageIndex; - firstLap = false; - } else - pageIndex = 0; - // Loop for every page. - for (int i = startAtPage; i < NO_PAGES_IN_MBYTE; i++) { - - if (pageIndex == 0) { - thePageHeader = (PageHeader *) &redoLogPage[i*PAGESIZE]; - // Print out mbyte number, page number and page index. - ndbout << j << ":" << i << ":" << pageIndex << endl - << " " << j*32 + i << ":" << pageIndex << " "; - if (thePrintFlag) ndbout << (*thePageHeader); - if (theCheckFlag) { - if(!thePageHeader->check()) { - ndbout << "Error in thePageHeader->check()" << endl; - doExit(); - } + words_from_previous_page = 0; - Uint32 checkSum = 37; - for (int ps = 1; ps < PAGESIZE; ps++) - checkSum = redoLogPage[i*PAGESIZE+ps] ^ checkSum; + // Loop for every page. + for (int i = 0; i < NO_PAGES_IN_MBYTE; i++) { + wordIndex = 0; + thePageHeader = (PageHeader *) &redoLogPage[i*PAGESIZE]; + // Print out mbyte number, page number and page index. + ndbout << j << ":" << i << ":" << wordIndex << endl + << " " << j*32 + i << ":" << wordIndex << " "; + if (thePrintFlag) ndbout << (*thePageHeader); + if (theCheckFlag) { + if(!thePageHeader->check()) { + ndbout << "Error in thePageHeader->check()" << endl; + doExit(); + } - if (checkSum != redoLogPage[i*PAGESIZE]){ - ndbout << "WRONG CHECKSUM: checksum = " << redoLogPage[i*PAGESIZE] - << " expected = " << checkSum << endl; - doExit(); - } - else - ndbout << "expected checksum: " << checkSum << endl; + Uint32 checkSum = 37; + for (int ps = 1; ps < PAGESIZE; ps++) + checkSum = redoLogPage[i*PAGESIZE+ps] ^ checkSum; + if (checkSum != redoLogPage[i*PAGESIZE]){ + ndbout << "WRONG CHECKSUM: checksum = " << redoLogPage[i*PAGESIZE] + << " expected = " << checkSum << endl; + doExit(); } - pageIndex += thePageHeader->getLogRecordSize(); + else + ndbout << "expected checksum: " << checkSum << endl; + } + lastPage = i != 0 && thePageHeader->lastPage(); + Uint32 lastWord = thePageHeader->lastWord(); + if (onlyMbyteHeaders) { // Show only the first page header in every mbyte of the file. break; @@ -132,18 +130,40 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (onlyPageHeaders) { // Show only page headers. Continue with the next page in this for loop. - pageIndex = 0; continue; } + + wordIndex = thePageHeader->getLogRecordSize() - words_from_previous_page; + Uint32 *redoLogPagePos = redoLogPage + i*PAGESIZE; + if (words_from_previous_page) + { + memmove(redoLogPagePos + wordIndex , + redoLogPagePos - words_from_previous_page, + words_from_previous_page*4); + } + do { - // Print out mbyte number, page number and page index. - ndbout << j << ":" << i << ":" << pageIndex << endl - << " " << j*32 + i << ":" << pageIndex << " "; - recordType = redoLogPage[i*PAGESIZE + pageIndex]; + if (words_from_previous_page) + { + // Print out mbyte number, page number and word index. + ndbout << j << ":" << i-1 << ":" << PAGESIZE-words_from_previous_page << endl + << j << ":" << i << ":" << wordIndex+words_from_previous_page << endl + << " " << j*32 + i-1 << ":" << PAGESIZE-words_from_previous_page << " "; + words_from_previous_page = 0; + } + else + { + // Print out mbyte number, page number and word index. + ndbout << j << ":" << i << ":" << wordIndex << endl + << " " << j*32 + i << ":" << wordIndex << " "; + } + redoLogPagePos = redoLogPage + i*PAGESIZE + wordIndex; + oldWordIndex = wordIndex; + recordType = *redoLogPagePos; switch(recordType) { case ZFD_TYPE: - fdRecord = (FileDescriptor *) &redoLogPage[i*PAGESIZE + pageIndex]; + fdRecord = (FileDescriptor *) redoLogPagePos; if (thePrintFlag) ndbout << (*fdRecord); if (theCheckFlag) { if(!fdRecord->check()) { @@ -155,13 +175,13 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read delete [] redoLogPage; exit(RETURN_OK); } - pageIndex += fdRecord->getLogRecordSize(); + wordIndex += fdRecord->getLogRecordSize(); break; case ZNEXT_LOG_RECORD_TYPE: - nlRecord = (NextLogRecord *) (&redoLogPage[i*PAGESIZE] + pageIndex); - pageIndex += nlRecord->getLogRecordSize(pageIndex); - if (pageIndex <= PAGESIZE) { + nlRecord = (NextLogRecord *) redoLogPagePos; + wordIndex += nlRecord->getLogRecordSize(wordIndex); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*nlRecord); if (theCheckFlag) { if(!nlRecord->check()) { @@ -173,9 +193,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read break; case ZCOMPLETED_GCI_TYPE: - cGCIrecord = (CompletedGCIRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += cGCIrecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + cGCIrecord = (CompletedGCIRecord *) redoLogPagePos; + wordIndex += cGCIrecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*cGCIrecord); if (theCheckFlag) { if(!cGCIrecord->check()) { @@ -187,9 +207,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read break; case ZPREP_OP_TYPE: - poRecord = (PrepareOperationRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += poRecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + poRecord = (PrepareOperationRecord *) redoLogPagePos; + wordIndex += poRecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*poRecord); if (theCheckFlag) { if(!poRecord->check()) { @@ -198,15 +218,12 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read } } } - else { - oldPageIndex = pageIndex - poRecord->getLogRecordSize(); - } break; case ZCOMMIT_TYPE: - ctRecord = (CommitTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += ctRecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + ctRecord = (CommitTransactionRecord *) redoLogPagePos; + wordIndex += ctRecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*ctRecord); if (theCheckFlag) { if(!ctRecord->check()) { @@ -215,15 +232,12 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read } } } - else { - oldPageIndex = pageIndex - ctRecord->getLogRecordSize(); - } break; case ZINVALID_COMMIT_TYPE: - ictRecord = (InvalidCommitTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += ictRecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + ictRecord = (InvalidCommitTransactionRecord *) redoLogPagePos; + wordIndex += ictRecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*ictRecord); if (theCheckFlag) { if(!ictRecord->check()) { @@ -232,21 +246,18 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read } } } - else { - oldPageIndex = pageIndex - ictRecord->getLogRecordSize(); - } break; case ZNEXT_MBYTE_TYPE: - nmRecord = (NextMbyteRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; + nmRecord = (NextMbyteRecord *) redoLogPagePos; if (thePrintFlag) ndbout << (*nmRecord); i = NO_PAGES_IN_MBYTE; break; case ZABORT_TYPE: - atRecord = (AbortTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += atRecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + atRecord = (AbortTransactionRecord *) redoLogPagePos; + wordIndex += atRecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*atRecord); if (theCheckFlag) { if(!atRecord->check()) { @@ -266,7 +277,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read ndbout << " ------ERROR: UNKNOWN RECORD TYPE------" << endl; // Print out remaining data in this page - for (int j = pageIndex; j < PAGESIZE; j++){ + for (int j = wordIndex; j < PAGESIZE; j++){ Uint32 unknown = redoLogPage[i*PAGESIZE + j]; ndbout_c("%-30d%-12u%-12x", j, unknown, unknown); @@ -274,14 +285,18 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read doExit(); } - } while(pageIndex < PAGESIZE && i < NO_PAGES_IN_MBYTE); + } while(wordIndex < lastWord && i < NO_PAGES_IN_MBYTE); + - if (pageIndex > PAGESIZE) { - // The last record overlapped page boundary. Must redo that record. - pageIndex = readRecordOverPageBoundary(&redoLogPage[i*PAGESIZE], - pageIndex, oldPageIndex, recordType); + if (lastPage) + break; + + if (wordIndex > PAGESIZE) { + words_from_previous_page = PAGESIZE - oldWordIndex; + ndbout << " ----------- Record continues on next page -----------" << endl; } else { - pageIndex = 0; + wordIndex = 0; + words_from_previous_page = 0; } ndbout << endl; }//for @@ -314,93 +329,6 @@ Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords) { // //---------------------------------------------------------------- -Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 oldPageIndex, Uint32 recordType) { - Uint32 pageHeader[PAGEHEADERSIZE]; - Uint32 tmpPages[PAGESIZE*10]; - PageHeader *thePageHeader; - Uint32 recordSize = 0; - - PrepareOperationRecord *poRecord; - CommitTransactionRecord *ctRecord; - InvalidCommitTransactionRecord *ictRecord; - - memcpy(pageHeader, pagePtr + PAGESIZE, PAGEHEADERSIZE*sizeof(Uint32)); - memcpy(tmpPages, pagePtr + oldPageIndex, (PAGESIZE - oldPageIndex)*sizeof(Uint32)); - memcpy(tmpPages + PAGESIZE - oldPageIndex , - (pagePtr + PAGESIZE + PAGEHEADERSIZE), - (PAGESIZE - PAGEHEADERSIZE)*sizeof(Uint32)); - - switch(recordType) { - case ZPREP_OP_TYPE: - poRecord = (PrepareOperationRecord *) tmpPages; - recordSize = poRecord->getLogRecordSize(); - if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { - if (theCheckFlag) { - if(!poRecord->check()) { - ndbout << "Error in poRecord->check() (readRecordOverPageBoundary)" << endl; - doExit(); - } - } - if (thePrintFlag) ndbout << (*poRecord); - } else { - ndbout << "Error: Record greater than a Page" << endl; - } - break; - - case ZCOMMIT_TYPE: - ctRecord = (CommitTransactionRecord *) tmpPages; - recordSize = ctRecord->getLogRecordSize(); - if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { - if (theCheckFlag) { - if(!ctRecord->check()) { - ndbout << "Error in ctRecord->check() (readRecordOverPageBoundary)" << endl; - doExit(); - } - } - if (thePrintFlag) ndbout << (*ctRecord); - } else { - ndbout << endl << "Error: Record greater than a Page" << endl; - } - break; - - case ZINVALID_COMMIT_TYPE: - ictRecord = (InvalidCommitTransactionRecord *) tmpPages; - recordSize = ictRecord->getLogRecordSize(); - if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { - if (theCheckFlag) { - if(!ictRecord->check()) { - ndbout << "Error in ictRecord->check() (readRecordOverPageBoundary)" << endl; - doExit(); - } - } - if (thePrintFlag) ndbout << (*ictRecord); - } else { - ndbout << endl << "Error: Record greater than a Page" << endl; - } - break; - - case ZNEW_PREP_OP_TYPE: - case ZABORT_TYPE: - case ZFRAG_SPLIT_TYPE: - case ZNEXT_MBYTE_TYPE: - ndbout << endl << "Record type = " << recordType << " not implemented." << endl; - return 0; - - default: - ndbout << endl << "Error: Unknown record type. Record type = " << recordType << endl; - return 0; - } - - thePageHeader = (PageHeader *) (pagePtr + PAGESIZE); - if (thePrintFlag) ndbout << (*thePageHeader); - - return PAGEHEADERSIZE - PAGESIZE + oldPageIndex + recordSize; -} - -//---------------------------------------------------------------- -// -//---------------------------------------------------------------- - void usage(const char * prg){ ndbout << endl << "Usage: " << endl << prg diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index f985e44d307..cf3c6056d65 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -1108,20 +1108,15 @@ private: void execTUP_SRREQ(Signal* signal); void execTUP_PREPLCPREQ(Signal* signal); void execFSOPENCONF(Signal* signal); - void execFSOPENREF(Signal* signal); void execFSCLOSECONF(Signal* signal); - void execFSCLOSEREF(Signal* signal); void execFSWRITECONF(Signal* signal); - void execFSWRITEREF(Signal* signal); void execFSREADCONF(Signal* signal); - void execFSREADREF(Signal* signal); void execNDB_STTOR(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); void execSET_VAR_REQ(Signal* signal); void execDROP_TAB_REQ(Signal* signal); void execALTER_TAB_REQ(Signal* signal); void execFSREMOVECONF(Signal* signal); - void execFSREMOVEREF(Signal* signal); void execTUP_ALLOCREQ(Signal* signal); void execTUP_DEALLOCREQ(Signal* signal); void execTUP_WRITELOG_REQ(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index f02a804aa83..52ac96bc5d3 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -25,7 +25,6 @@ #include <AttributeHeader.hpp> #include <Interpreter.hpp> #include <signaldata/FsConf.hpp> -#include <signaldata/FsRef.hpp> #include <signaldata/FsRemoveReq.hpp> #include <signaldata/TupCommit.hpp> #include <signaldata/TupKey.hpp> @@ -117,13 +116,9 @@ Dbtup::Dbtup(const class Configuration & conf) addRecSignal(GSN_TUP_SRREQ, &Dbtup::execTUP_SRREQ); addRecSignal(GSN_TUP_PREPLCPREQ, &Dbtup::execTUP_PREPLCPREQ); addRecSignal(GSN_FSOPENCONF, &Dbtup::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dbtup::execFSOPENREF); addRecSignal(GSN_FSCLOSECONF, &Dbtup::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dbtup::execFSCLOSEREF); addRecSignal(GSN_FSWRITECONF, &Dbtup::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dbtup::execFSWRITEREF); addRecSignal(GSN_FSREADCONF, &Dbtup::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dbtup::execFSREADREF); addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR); addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ, true); addRecSignal(GSN_SET_VAR_REQ, &Dbtup::execSET_VAR_REQ); @@ -133,7 +128,6 @@ Dbtup::Dbtup(const class Configuration & conf) addRecSignal(GSN_DROP_TRIG_REQ, &Dbtup::execDROP_TRIG_REQ); addRecSignal(GSN_DROP_TAB_REQ, &Dbtup::execDROP_TAB_REQ); - addRecSignal(GSN_FSREMOVEREF, &Dbtup::execFSREMOVEREF); addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF); addRecSignal(GSN_TUP_ALLOCREQ, &Dbtup::execTUP_ALLOCREQ); @@ -268,12 +262,6 @@ void Dbtup::execFSCLOSECONF(Signal* signal) releasePendingFileOpenInfoRecord(pfoPtr); }//Dbtup::execFSCLOSECONF() -void Dbtup::execFSCLOSEREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSCLOSEREF() - void Dbtup::execFSOPENCONF(Signal* signal) { PendingFileOpenInfoPtr pfoPtr; @@ -368,12 +356,6 @@ void Dbtup::execFSOPENCONF(Signal* signal) releasePendingFileOpenInfoRecord(pfoPtr); }//Dbtup::execFSOPENCONF() -void Dbtup::execFSOPENREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSOPENREF() - void Dbtup::execFSREADCONF(Signal* signal) { DiskBufferSegmentInfoPtr dbsiPtr; @@ -429,12 +411,6 @@ void Dbtup::execFSREADCONF(Signal* signal) }//switch }//Dbtup::execFSREADCONF() -void Dbtup::execFSREADREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSREADREF() - void Dbtup::execFSWRITECONF(Signal* signal) { DiskBufferSegmentInfoPtr dbsiPtr; @@ -483,12 +459,6 @@ void Dbtup::execFSWRITECONF(Signal* signal) return; }//Dbtup::execFSWRITECONF() -void Dbtup::execFSWRITEREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSWRITEREF() - void Dbtup::execCONTINUEB(Signal* signal) { ljamEntry(); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index 4ce807528c4..bacba2a880c 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -702,10 +702,3 @@ void Dbtup::execFSREMOVECONF(Signal* signal) initTab(tabPtr.p); }//Dbtup::execFSREMOVECONF() -void Dbtup::execFSREMOVEREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSREMOVEREF() - - diff --git a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp index 639d300d6df..657133bda36 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp +++ b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp @@ -309,7 +309,6 @@ private: Uint32 c_fsRemoveCount; Uint32 c_nodeGroup; void clearFilesystem(Signal* signal); - void execFSREMOVEREF(Signal* signal); void execFSREMOVECONF(Signal* signal); NdbNodeBitmask c_allDefinedNodes; diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp index c7b472fc91a..97ca3f44b3a 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp @@ -100,7 +100,6 @@ Ndbcntr::Ndbcntr(const class Configuration & conf): addRecSignal(GSN_STTORRY, &Ndbcntr::execSTTORRY); addRecSignal(GSN_READ_CONFIG_CONF, &Ndbcntr::execREAD_CONFIG_CONF); - addRecSignal(GSN_FSREMOVEREF, &Ndbcntr::execFSREMOVEREF); addRecSignal(GSN_FSREMOVECONF, &Ndbcntr::execFSREMOVECONF); initData(); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index c837321a52d..6f28bb03537 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -144,6 +144,7 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal) const SystemError * const sysErr = (SystemError *)signal->getDataPtr(); char buf[100]; int killingNode = refToNode(sysErr->errorRef); + Uint32 data1 = sysErr->data1; jamEntry(); switch (sysErr->errorCode){ @@ -178,8 +179,9 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal) case SystemError::CopyFragRefError: BaseString::snprintf(buf, sizeof(buf), "Node %d killed this node because " - "it could not copy a fragment during node restart", - killingNode); + "it could not copy a fragment during node restart. " + "Copy fragment error code: %u.", + killingNode, data1); break; default: @@ -2392,12 +2394,6 @@ Ndbcntr::clearFilesystem(Signal* signal){ } void -Ndbcntr::execFSREMOVEREF(Signal* signal){ - jamEntry(); - ndbrequire(0); -} - -void Ndbcntr::execFSREMOVECONF(Signal* signal){ jamEntry(); if(c_fsRemoveCount == 13){ diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index ef9f2c3c716..57a4032e40b 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -29,6 +29,7 @@ #include <signaldata/EventReport.hpp> #include <signaldata/ContinueFragmented.hpp> #include <signaldata/NodeStateSignalData.hpp> +#include <signaldata/FsRef.hpp> #include <DebuggerNames.hpp> #include "LongSignal.hpp" @@ -140,6 +141,13 @@ SimulatedBlock::installSimulatedBlockFunctions(){ a[GSN_UTIL_UNLOCK_REF] = &SimulatedBlock::execUTIL_UNLOCK_REF; a[GSN_UTIL_UNLOCK_CONF] = &SimulatedBlock::execUTIL_UNLOCK_CONF; a[GSN_READ_CONFIG_REQ] = &SimulatedBlock::execREAD_CONFIG_REQ; + a[GSN_FSOPENREF] = &SimulatedBlock::execFSOPENREF; + a[GSN_FSCLOSEREF] = &SimulatedBlock::execFSCLOSEREF; + a[GSN_FSWRITEREF] = &SimulatedBlock::execFSWRITEREF; + a[GSN_FSREADREF] = &SimulatedBlock::execFSREADREF; + a[GSN_FSREMOVEREF] = &SimulatedBlock::execFSREMOVEREF; + a[GSN_FSSYNCREF] = &SimulatedBlock::execFSSYNCREF; + a[GSN_FSAPPENDREF] = &SimulatedBlock::execFSAPPENDREF; } void @@ -1781,6 +1789,61 @@ SimulatedBlock::execUPGRADE(Signal* signal){ } } +void +SimulatedBlock::fsRefError(Signal* signal, Uint32 line, const char *msg) +{ + const FsRef *fsRef = (FsRef*)signal->getDataPtr(); + Uint32 errorCode = fsRef->errorCode; + Uint32 osErrorCode = fsRef->osErrorCode; + char msg2[100]; + + sprintf(msg2, "%s: %s. OS errno: %u", getBlockName(number()), msg, osErrorCode); + + progError(line, errorCode, msg2); +} + +void +SimulatedBlock::execFSWRITEREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system write failed"); +} + +void +SimulatedBlock::execFSREADREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system read failed"); +} + +void +SimulatedBlock::execFSCLOSEREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system close failed"); +} + +void +SimulatedBlock::execFSOPENREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system open failed"); +} + +void +SimulatedBlock::execFSREMOVEREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system remove failed"); +} + +void +SimulatedBlock::execFSSYNCREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system sync failed"); +} + +void +SimulatedBlock::execFSAPPENDREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system append failed"); +} + #ifdef VM_TRACE void SimulatedBlock::clear_global_variables(){ diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index 50c85a0b274..bba92ca7c31 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -507,6 +507,15 @@ private: protected: void execUPGRADE(Signal* signal); + void fsRefError(Signal* signal, Uint32 line, const char *msg); + void execFSWRITEREF(Signal* signal); + void execFSREADREF(Signal* signal); + void execFSOPENREF(Signal* signal); + void execFSCLOSEREF(Signal* signal); + void execFSREMOVEREF(Signal* signal); + void execFSSYNCREF(Signal* signal); + void execFSAPPENDREF(Signal* signal); + // Variable for storing inserted errors, see pc.H ERROR_INSERT_VARIABLE; |