From: jonas.oreland Date: July 15 2005 11:26am Subject: bk commit into 5.1 tree (joreland:1.1943) List-Archive: http://lists.mysql.com/internals/27145 Message-Id: <20050715112624.F2116126457@eel> Below is the list of changes that have just been committed into a local 5.1 repository of jonas. When jonas does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1943 05/07/15 13:26:17 joreland@stripped +6 -0 ndb diskdata introduce restart seq, to be able to fix first time page loads storage/ndb/src/kernel/vm/GlobalData.hpp 1.8 05/07/15 13:26:13 joreland@stripped +2 -1 Introduce restart sequnce Incremented by one everytime _this_ node is started storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp 1.13 05/07/15 13:26:12 joreland@stripped +6 -3 Add restart sequence to all tup pages. Ta be able to detect "first time" pages storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp 1.9 05/07/15 13:26:12 joreland@stripped +1 -1 Move assert storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp 1.8 05/07/15 13:26:12 joreland@stripped +3 -1 Introduce restart sequnce Incremented by one everytime _this_ node is started storage/ndb/src/kernel/blocks/dbdih/Sysfile.hpp 1.4 05/07/15 13:26:12 joreland@stripped +6 -6 Introduce restart sequnce Incremented by one everytime _this_ node is started storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 1.31 05/07/15 13:26:12 joreland@stripped +10 -2 Introduce restart sequnce Incremented by one everytime _this_ node is started # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: joreland # Host: eel.(none) # Root: /home/jonas/src/mysql-5.1-ndb-dd --- 1.8/storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp 2005-07-12 14:03:27 +02:00 +++ 1.9/storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp 2005-07-15 13:26:12 +02:00 @@ -21,6 +21,7 @@ Uint32 Tup_fixsize_page::alloc_record() { + assert(free_space); Uint32 freeListHeader = next_free_index; Uint32 startTuple = freeListHeader >> 16; Uint32 endTuple = freeListHeader & 0xffff; @@ -31,7 +32,6 @@ assert(startTuple < DATA_WORDS); Uint32 next = m_data[startTuple] & 0xFFFF; next_free_index = endTuple + (next << 16); - assert(free_space); free_space --; return startTuple; } else { --- 1.12/storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp 2005-07-12 14:03:27 +02:00 +++ 1.13/storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp 2005-07-15 13:26:12 +02:00 @@ -23,6 +23,7 @@ struct Tup_page { struct File_formats::Page_header m_page_header; + Uint32 m_restart_seq; Uint32 page_state; union { Uint32 next_page; @@ -47,7 +48,7 @@ Uint32 m_table_id; Uint32 m_fragment_id; Uint32 m_extent_info_ptr; - Uint32 unused_ph[11]; + Uint32 unused_ph[10]; STATIC_CONST( DATA_WORDS = File_formats::PAGE_SIZE_WORDS - 32 ); @@ -57,6 +58,7 @@ struct Tup_fixsize_page { struct File_formats::Page_header m_page_header; + Uint32 m_restart_seq; Uint32 page_state; Uint32 next_page; Uint32 prev_page; @@ -75,7 +77,7 @@ Uint32 m_table_id; Uint32 m_fragment_id; Uint32 m_extent_info_ptr; - Uint32 unused_ph[11]; + Uint32 unused_ph[10]; STATIC_CONST( DATA_WORDS = File_formats::PAGE_SIZE_WORDS - 32 ); @@ -97,6 +99,7 @@ struct Tup_varsize_page { struct File_formats::Page_header m_page_header; + Uint32 m_restart_seq; Uint32 page_state; Uint32 next_page; Uint32 prev_page; @@ -117,7 +120,7 @@ Uint32 m_extent_info_ptr; Uint32 high_index; // size of index + 1 Uint32 insert_pos; - Uint32 unused_ph[9]; + Uint32 unused_ph[8]; STATIC_CONST( DATA_WORDS = File_formats::PAGE_SIZE_WORDS - 32 ); STATIC_CONST( CHAIN = 0x8000 ); --- 1.30/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2005-06-13 15:24:49 +02:00 +++ 1.31/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2005-07-15 13:26:12 +02:00 @@ -639,9 +639,11 @@ c_copyGCISlave.m_expectedNextWord += CopyGCIReq::DATA_SIZE; return; }//if - + + Uint32 tmp= SYSFILE->m_restart_seq; memcpy(sysfileData, cdata, sizeof(sysfileData)); - + SYSFILE->m_restart_seq = tmp; + c_copyGCISlave.m_copyReason = reason; c_copyGCISlave.m_senderRef = signal->senderBlockRef(); c_copyGCISlave.m_senderData = copyGCI->anyData; @@ -1587,12 +1589,15 @@ * * But dont copy lastCompletedGCI:s */ + Uint32 key = SYSFILE->m_restart_seq; Uint32 tempGCP[MAX_NDB_NODES]; for(i = 0; i < MAX_NDB_NODES; i++) tempGCP[i] = SYSFILE->lastCompletedGCI[i]; for(i = 0; i < Sysfile::SYSFILE_SIZE32; i++) sysfileData[i] = cdata[i]; + + SYSFILE->m_restart_seq = key; for(i = 0; i < MAX_NDB_NODES; i++) SYSFILE->lastCompletedGCI[i] = tempGCP[i]; @@ -3449,6 +3454,7 @@ /* WE ALSO COPY TO OUR OWN NODE. TO ENABLE US TO DO THIS PROPERLY WE */ /* START BY CLOSING THIS FILE. */ /* ----------------------------------------------------------------------- */ + globalData.m_restart_seq = ++SYSFILE->m_restart_seq; closeFile(signal, filePtr); filePtr.p->reqStatus = FileRecord::CLOSING_GCP; }//Dbdih::readingGcpLab() @@ -11050,6 +11056,8 @@ SYSFILE->takeOver[i] = 0; }//for Sysfile::setInitialStartOngoing(SYSFILE->systemRestartBits); + srand(time(0)); + globalData.m_restart_seq = SYSFILE->m_restart_seq = 0; }//Dbdih::initRestartInfo() /*--------------------------------------------------------------------*/ --- 1.3/storage/ndb/src/kernel/blocks/dbdih/Sysfile.hpp 2005-04-08 02:44:04 +02:00 +++ 1.4/storage/ndb/src/kernel/blocks/dbdih/Sysfile.hpp 2005-07-15 13:26:12 +02:00 @@ -33,11 +33,6 @@ #define NO_NODE_GROUP_ID ((1 << NODEID_BITS) - 1) /** - * Dummy macro to make emacs indent better - */ -#define _F(x) x - -/** * No of 32 bits word in sysfile * * 5 + @@ -47,7 +42,7 @@ * NODE_ARRAY_SIZE(MAX_NDB_NODES, NODEID_BITS) + // takeOver * NodeBitmask::NDB_NODE_BITMASK_SIZE // Lcp Active */ -#define _SYSFILE_SIZE32 (5 + \ +#define _SYSFILE_SIZE32 (6 + \ MAX_NDB_NODES + \ NODE_ARRAY_SIZE(MAX_NDB_NODES, 4) + \ NODE_ARRAY_SIZE(MAX_NDB_NODES, NODEID_BITS) + \ @@ -66,6 +61,11 @@ STATIC_CONST( SYSFILE_SIZE32 = _SYSFILE_SIZE32 ); Uint32 systemRestartBits; + + /** + * Restart seq for _this_ node... + */ + Uint32 m_restart_seq; static bool getInitialStartOngoing(const Uint32 & systemRestartBits); static void setInitialStartOngoing(Uint32 & systemRestartBits); --- 1.7/storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp 2005-04-30 13:42:56 +02:00 +++ 1.8/storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp 2005-07-15 13:26:12 +02:00 @@ -67,7 +67,9 @@ void print(const char * filename, const Sysfile * sysfile){ char buf[255]; - ndbout << "----- Sysfile: " << filename << " -----" << endl; + ndbout << "----- Sysfile: " << filename + << " seq: " << hex << sysfile->m_restart_seq + << " -----" << endl; ndbout << "Initial start ongoing: " << Sysfile::getInitialStartOngoing(sysfile->systemRestartBits) << ", "; --- 1.7/storage/ndb/src/kernel/vm/GlobalData.hpp 2005-04-29 16:30:28 +02:00 +++ 1.8/storage/ndb/src/kernel/vm/GlobalData.hpp 2005-07-15 13:26:13 +02:00 @@ -35,8 +35,9 @@ perform_stop}; struct GlobalData { + Uint32 m_restart_seq; // NodeInfo m_nodeInfo[MAX_NODES]; - Signal VMSignals[1]; // Owned by FastScheduler:: + Signal VMSignals[1]; // Owned by FastScheduler:: Uint64 internalMillisecCounter; // Owned by ThreadConfig:: Uint32 highestAvailablePrio; // Owned by FastScheduler::