#At file:///home/jonas/src/telco-6.3/ based on revid:frazer@stripped
3094 Jonas Oreland 2009-10-08
ndb - bug#47908 - store mbyte pos as Uint16 to allow >256M FragmentLogFileSize
modified:
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp
storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp
storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2009-09-22 07:39:17 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2009-10-08 06:24:59 +0000
@@ -1340,17 +1340,17 @@ public:
* invalidated.
*/
Uint16 savePageIndex;
- Uint8 logTailMbyte;
+ Uint16 logTailMbyte;
/**
* The mbyte within the starting log file where to start
* executing the log.
*/
- Uint8 startMbyte;
+ Uint16 startMbyte;
/**
* The last mbyte in which to execute the log during system
* restart.
*/
- Uint8 stopMbyte;
+ Uint16 stopMbyte;
/**
* This variable refers to the file where invalidation is
* occuring during system/node restart.
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp 2009-09-03 09:14:28 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp 2009-10-08 06:24:59 +0000
@@ -60,7 +60,8 @@ Uint32 *redoLogPage;
unsigned NO_MBYTE_IN_FILE = 16;
NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read a redo log file", 16384) {
- Uint32 wordIndex = 0;
+ ndb_init();
+ Int32 wordIndex = 0;
Uint32 oldWordIndex = 0;
Uint32 recordType = 1234567890;
@@ -166,7 +167,7 @@ NDB_COMMAND(redoLogFileReader, "redoLog
Uint32 *redoLogPagePos = redoLogPage + i*PAGESIZE;
if (words_from_previous_page)
{
- memmove(redoLogPagePos + wordIndex ,
+ memmove(redoLogPagePos + wordIndex,
redoLogPagePos - words_from_previous_page,
words_from_previous_page*4);
}
@@ -183,8 +184,8 @@ NDB_COMMAND(redoLogFileReader, "redoLog
else
{
// Print out mbyte number, page number and word index.
- ndbout << j << ":" << i << ":" << wordIndex << endl
- << " " << j*32 + i << ":" << wordIndex << " ";
+ ndbout_c("mb: %u fp: %u pos: %u",
+ j, (j*32 + i), wordIndex);
}
redoLogPagePos = redoLogPage + i*PAGESIZE + wordIndex;
oldWordIndex = wordIndex;
@@ -319,7 +320,7 @@ NDB_COMMAND(redoLogFileReader, "redoLog
wordIndex = lastWord;
}
}
- } while(wordIndex < lastWord && i < NO_PAGES_IN_MBYTE);
+ } while(wordIndex < (Int32)lastWord && i < NO_PAGES_IN_MBYTE);
if (false && lastPage)
@@ -435,10 +436,6 @@ void readArguments(int argc, const char*
onlyLap = true;
} else if (strcmp(argv[i], "-mbyte") == 0) {
startAtMbyte = atoi(argv[i+1]);
- if (startAtMbyte > 15) {
- usage(argv[0]);
- doExit();
- }
argc--;
i++;
} else if (strcmp(argv[i], "-page") == 0) {
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp 2009-09-03 08:15:17 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp 2009-10-08 06:24:59 +0000
@@ -293,41 +293,47 @@ Uint32 FileDescriptor::getLogRecordSize(
+ m_fdHeader.m_noOfDescriptors * NO_MBYTE_IN_FILE * FILEDESCRIPTORENTRYSIZE;
}
+static
+const Uint32 *
+printFileDescriptorRecord(Uint32 no, const Uint32 * ptr)
+{
+ ndbout << "------------------FILE DESCRIPTOR " << no
+ <<" ---------------------" << endl << endl;
+ ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex");
+
+ const Uint32 * completed = ptr;
+ const Uint32 * started = (ptr + NO_MBYTE_IN_FILE);
+ const Uint32 * prepref = (ptr + 2 * NO_MBYTE_IN_FILE);
+ for(unsigned i = 0; i < NO_MBYTE_IN_FILE; i++)
+ {
+ ndbout_c(" mb: %u Max GCI completed: %u"
+ " Max GCI started: %u Last prepared ref: %u (file: %u mb: %u)",
+ i,
+ completed[i],
+ started[i],
+ prepref[i],
+ (prepref[i] >> 16),
+ (prepref[i] & 65535));
+ }
+ ndbout << endl;
+ return ptr + 3 * NO_MBYTE_IN_FILE;
+}
+
+
NdbOut& operator<<(NdbOut& no, const FileDescriptor& fd) {
no << "-------FILE DESCRIPTOR HEADER------------------" << endl << endl;
printOut("Record type:", fd.m_fdHeader.m_recordType);
printOut("Number of file descriptors:", fd.m_fdHeader.m_noOfDescriptors);
printOut("File number:", fd.m_fdHeader.m_fileNo);
ndbout << endl;
- for(Uint32 i = 0; i < fd.m_fdHeader.m_noOfDescriptors; i++) {
- fd.printARecord(i);
+ const Uint32 * ptr = fd.m_fdRecord;
+ for(Uint32 i = 0; i < fd.m_fdHeader.m_noOfDescriptors; i++)
+ {
+ ptr = printFileDescriptorRecord(i, ptr);
}
return no;
}
-void FileDescriptor::printARecord( Uint32 recordIndex ) const {
- ndbout << "------------------FILE DESCRIPTOR " << recordIndex
- <<" ---------------------" << endl << endl;
- ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex");
-
- for(unsigned i = 1; i <= NO_MBYTE_IN_FILE; i++) {
- ndbout_c("%s%2d%s%-12u%-12x", "Max GCI completed, mbyte ", i, ": ",
- m_fdRecord[recordIndex].m_maxGciCompleted[i-1],
- m_fdRecord[recordIndex].m_maxGciCompleted[i-1]);
- }
- for(unsigned i = 1; i <= NO_MBYTE_IN_FILE; i++) {
- ndbout_c("%s%2d%s%-12u%-12x", "Max GCI started, mbyte ", i, ": ",
- m_fdRecord[recordIndex].m_maxGciStarted[i-1],
- m_fdRecord[recordIndex].m_maxGciStarted[i-1]);
- }
- for(unsigned i = 1; i <= NO_MBYTE_IN_FILE; i++) {
- ndbout_c("%s%2d%s%-12u%-12x", "Last prepared ref, mbyte ", i, ": ",
- m_fdRecord[recordIndex].m_lastPreparedReference[i-1],
- m_fdRecord[recordIndex].m_lastPreparedReference[i-1]);
- }
- ndbout << endl;
-}
-
bool FileDescriptor::check() {
// Not implemented yet.
return true;
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp 2009-09-03 08:15:17 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp 2009-10-08 06:24:59 +0000
@@ -174,14 +174,8 @@ public:
Uint32 m_fileNo;
};
-class FileDescriptorRecord {
-public:
- Uint32 m_maxGciCompleted[16];
- Uint32 m_maxGciStarted[16];
- Uint32 m_lastPreparedReference[16];
-};
-
-class FileDescriptor {
+class FileDescriptor
+{
friend NdbOut& operator<<(NdbOut&, const FileDescriptor&);
public:
bool check();
@@ -189,7 +183,7 @@ public:
protected:
void printARecord( Uint32 ) const;
FileDescriptorHeader m_fdHeader;
- FileDescriptorRecord m_fdRecord[1];
+ Uint32 m_fdRecord[1];
};
Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20091008062459-tttdj45t93ip5p35.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.3 branch (jonas:3094) Bug#47908 | Jonas Oreland | 8 Oct |