summaryrefslogtreecommitdiff
path: root/ndb/include
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2006-06-27 10:02:58 +0200
committerunknown <tomas@poseidon.ndb.mysql.com>2006-06-27 10:02:58 +0200
commit0335013f17743299cf32731e1db986170672acbe (patch)
tree488adca9faf349dbb5ca15701250f59938591434 /ndb/include
parent86a29d57181bb2a9e3eda9ef93b5c5ccaadf280d (diff)
downloadmariadb-git-0335013f17743299cf32731e1db986170672acbe.tar.gz
Bug #19852 Restoring backup made from cluster with full data memory fails
- make sure to allocate just enough pages in the fragments by using the actual row count from the backup, to avoid over allocation of pages to fragments, and thus avoid the bug ndb/include/kernel/GlobalSignalNumbers.h: Bug #19852 Restoring backup made from cluster with full data memory fails - distribute fragment complete to all participants to update row count ndb/include/kernel/signaldata/BackupContinueB.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - time slica writing of fragment info to ctl file ndb/include/kernel/signaldata/BackupImpl.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - 32 -> 64 bit on bytes and records - new signal fragment complete to all participants ndb/include/kernel/signaldata/BackupSignalData.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - 32 -> 64 bit on bytes and records ndb/include/kernel/signaldata/DictTabInfo.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - add min and max rows to dict tab info ndb/include/kernel/signaldata/LqhFrag.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added min and max rows to add frag req ndb/include/kernel/signaldata/TupFrag.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added min and max rows to add frag req ndb/include/ndbapi/NdbDictionary.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added get/set of min max rows ndb/src/common/debugger/signaldata/BackupImpl.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - 32 -> 64 bit on bytes and records ndb/src/common/debugger/signaldata/BackupSignalData.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - 32 -> 64 bit on bytes and records ndb/src/common/debugger/signaldata/DictTabInfo.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added min and max rows to dict tab info ndb/src/common/debugger/signaldata/LqhFrag.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added min and max rows to frag req ndb/src/kernel/blocks/backup/Backup.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - new section in backup with per fragment info in ctl file - 32 -> 64 bit on bytes and records ndb/src/kernel/blocks/backup/Backup.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - new section in backup with per fragment info in ctl file - 32 -> 64 bit on bytes and records ndb/src/kernel/blocks/backup/BackupFormat.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - new section in backup with per fragment info in ctl file - 32 -> 64 bit on bytes and records ndb/src/kernel/blocks/backup/BackupInit.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - new signal fragment complete to all participants ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added max and min rows to dict table object ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added max and min rows to dict table object ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added min and max rows to frag req ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added min and max rows to frag req ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added min and max rows to frag req ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - added min and max rows to frag req - move memory allocation to fragment to after adding of attributes to get correct headsize - allocate pages to fragments according to min rows setting ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - grow page allocation starting from 2 irrespective of first page allocation ndb/src/mgmsrv/MgmtSrvr.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - 32 -> 64 bits on bytes and records ndb/src/mgmsrv/MgmtSrvr.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - 32 -> 64 bits on bytes and records ndb/src/ndbapi/NdbDictionary.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - min and max rows in dict ndb/src/ndbapi/NdbDictionaryImpl.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - min and max rows in dict ndb/src/ndbapi/NdbDictionaryImpl.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - min and max rows in dict ndb/tools/restore/Restore.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - add retrieval of fragment info ndb/tools/restore/Restore.hpp: Bug #19852 Restoring backup made from cluster with full data memory fails - add retrieval of fragment info ndb/tools/restore/consumer_restore.cpp: Bug #19852 Restoring backup made from cluster with full data memory fails - set min in restore to the actual row count (this is the actual bug fix) sql/ha_ndbcluster.cc: Bug #19852 Restoring backup made from cluster with full data memory fails - set min and max rows according to sql definition
Diffstat (limited to 'ndb/include')
-rw-r--r--ndb/include/kernel/GlobalSignalNumbers.h4
-rw-r--r--ndb/include/kernel/signaldata/BackupContinueB.hpp3
-rw-r--r--ndb/include/kernel/signaldata/BackupImpl.hpp22
-rw-r--r--ndb/include/kernel/signaldata/BackupSignalData.hpp8
-rw-r--r--ndb/include/kernel/signaldata/DictTabInfo.hpp11
-rw-r--r--ndb/include/kernel/signaldata/LqhFrag.hpp25
-rw-r--r--ndb/include/kernel/signaldata/TupFrag.hpp15
-rw-r--r--ndb/include/ndbapi/NdbDictionary.hpp14
8 files changed, 81 insertions, 21 deletions
diff --git a/ndb/include/kernel/GlobalSignalNumbers.h b/ndb/include/kernel/GlobalSignalNumbers.h
index 98b6ce7d949..a84f3130abf 100644
--- a/ndb/include/kernel/GlobalSignalNumbers.h
+++ b/ndb/include/kernel/GlobalSignalNumbers.h
@@ -611,8 +611,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_WAIT_GCP_REF 500
#define GSN_WAIT_GCP_CONF 501
-/* 502 not used */
-
/**
* Trigger and index signals
*/
@@ -682,6 +680,8 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_BACKUP_FRAGMENT_REF 546
#define GSN_BACKUP_FRAGMENT_CONF 547
+#define GSN_BACKUP_FRAGMENT_COMPLETE_REP 502
+
#define GSN_STOP_BACKUP_REQ 548
#define GSN_STOP_BACKUP_REF 549
#define GSN_STOP_BACKUP_CONF 550
diff --git a/ndb/include/kernel/signaldata/BackupContinueB.hpp b/ndb/include/kernel/signaldata/BackupContinueB.hpp
index d3d3f79f310..fe3f48444ec 100644
--- a/ndb/include/kernel/signaldata/BackupContinueB.hpp
+++ b/ndb/include/kernel/signaldata/BackupContinueB.hpp
@@ -31,7 +31,8 @@ private:
BUFFER_UNDERFLOW = 1,
BUFFER_FULL_SCAN = 2,
BUFFER_FULL_FRAG_COMPLETE = 3,
- BUFFER_FULL_META = 4
+ BUFFER_FULL_META = 4,
+ BACKUP_FRAGMENT_INFO = 5
};
};
diff --git a/ndb/include/kernel/signaldata/BackupImpl.hpp b/ndb/include/kernel/signaldata/BackupImpl.hpp
index 298440ad377..07ab5bc543b 100644
--- a/ndb/include/kernel/signaldata/BackupImpl.hpp
+++ b/ndb/include/kernel/signaldata/BackupImpl.hpp
@@ -258,15 +258,31 @@ class BackupFragmentConf {
friend bool printBACKUP_FRAGMENT_CONF(FILE *, const Uint32 *, Uint32, Uint16);
public:
- STATIC_CONST( SignalLength = 6 );
+ STATIC_CONST( SignalLength = 8 );
private:
Uint32 backupId;
Uint32 backupPtr;
Uint32 tableId;
Uint32 fragmentNo;
- Uint32 noOfRecords;
- Uint32 noOfBytes;
+ Uint32 noOfRecordsLow;
+ Uint32 noOfBytesLow;
+ Uint32 noOfRecordsHigh;
+ Uint32 noOfBytesHigh;
+};
+
+class BackupFragmentCompleteRep {
+public:
+ STATIC_CONST( SignalLength = 8 );
+
+ Uint32 backupId;
+ Uint32 backupPtr;
+ Uint32 tableId;
+ Uint32 fragmentNo;
+ Uint32 noOfTableRowsLow;
+ Uint32 noOfFragmentRowsLow;
+ Uint32 noOfTableRowsHigh;
+ Uint32 noOfFragmentRowsHigh;
};
class StopBackupReq {
diff --git a/ndb/include/kernel/signaldata/BackupSignalData.hpp b/ndb/include/kernel/signaldata/BackupSignalData.hpp
index e1b8c6203a1..9e34ea3a211 100644
--- a/ndb/include/kernel/signaldata/BackupSignalData.hpp
+++ b/ndb/include/kernel/signaldata/BackupSignalData.hpp
@@ -201,17 +201,19 @@ class BackupCompleteRep {
friend bool printBACKUP_COMPLETE_REP(FILE *, const Uint32 *, Uint32, Uint16);
public:
- STATIC_CONST( SignalLength = 8 + NdbNodeBitmask::Size );
+ STATIC_CONST( SignalLength = 10 + NdbNodeBitmask::Size );
private:
Uint32 senderData;
Uint32 backupId;
Uint32 startGCP;
Uint32 stopGCP;
- Uint32 noOfBytes;
- Uint32 noOfRecords;
+ Uint32 noOfBytesLow;
+ Uint32 noOfRecordsLow;
Uint32 noOfLogBytes;
Uint32 noOfLogRecords;
NdbNodeBitmask nodes;
+ Uint32 noOfBytesHigh;
+ Uint32 noOfRecordsHigh;
};
/**
diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp
index bc4817f0cf3..3fcae69aa74 100644
--- a/ndb/include/kernel/signaldata/DictTabInfo.hpp
+++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp
@@ -117,9 +117,16 @@ public:
CustomTriggerId = 25,
FrmLen = 26,
FrmData = 27,
+
FragmentCount = 128, // No of fragments in table (!fragment replicas)
FragmentDataLen = 129,
FragmentData = 130, // CREATE_FRAGMENTATION reply
+
+ MaxRowsLow = 139,
+ MaxRowsHigh = 140,
+ MinRowsLow = 133,
+ MinRowsHigh = 144,
+
TableEnd = 999,
AttributeName = 1000, // String, Mandatory
@@ -263,6 +270,10 @@ public:
Uint32 FragmentCount;
Uint32 FragmentDataLen;
Uint16 FragmentData[(MAX_FRAGMENT_DATA_BYTES+1)/2];
+ Uint32 MaxRowsLow;
+ Uint32 MaxRowsHigh;
+ Uint32 MinRowsLow;
+ Uint32 MinRowsHigh;
void init();
};
diff --git a/ndb/include/kernel/signaldata/LqhFrag.hpp b/ndb/include/kernel/signaldata/LqhFrag.hpp
index 13dfafcc653..50b0caaba07 100644
--- a/ndb/include/kernel/signaldata/LqhFrag.hpp
+++ b/ndb/include/kernel/signaldata/LqhFrag.hpp
@@ -104,7 +104,7 @@ class LqhFragReq {
friend bool printLQH_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16);
public:
- STATIC_CONST( SignalLength = 25 );
+ STATIC_CONST( SignalLength = 24 );
enum RequestInfo {
CreateInRunning = 0x8000000,
@@ -115,27 +115,32 @@ private:
Uint32 senderData;
Uint32 senderRef;
Uint32 fragmentId;
- Uint32 requestInfo;
+ Uint8 requestInfo;
+ Uint8 unused1;
+ Uint16 noOfAttributes;
Uint32 tableId;
Uint32 localKeyLength;
- Uint32 maxLoadFactor;
- Uint32 minLoadFactor;
- Uint32 kValue;
+ Uint16 maxLoadFactor;
+ Uint16 minLoadFactor;
+ Uint16 kValue;
+ Uint8 tableType; // DictTabInfo::TableType
+ Uint8 GCPIndicator;
Uint32 lh3DistrBits;
Uint32 lh3PageBits;
- Uint32 noOfAttributes;
Uint32 noOfNullAttributes;
- Uint32 noOfPagesToPreAllocate;
+ Uint32 maxRowsLow;
+ Uint32 maxRowsHigh;
+ Uint32 minRowsLow;
+ Uint32 minRowsHigh;
Uint32 schemaVersion;
Uint32 keyLength;
Uint32 nextLCP;
Uint32 noOfKeyAttr;
- Uint32 noOfNewAttr; // noOfCharsets in upper half
+ Uint16 noOfNewAttr;
+ Uint16 noOfCharsets;
Uint32 checksumIndicator;
Uint32 noOfAttributeGroups;
- Uint32 GCPIndicator;
Uint32 startGci;
- Uint32 tableType; // DictTabInfo::TableType
Uint32 primaryTableId; // table of index or RNIL
};
diff --git a/ndb/include/kernel/signaldata/TupFrag.hpp b/ndb/include/kernel/signaldata/TupFrag.hpp
index 5fb9d7bcf42..c9f2ad5382f 100644
--- a/ndb/include/kernel/signaldata/TupFrag.hpp
+++ b/ndb/include/kernel/signaldata/TupFrag.hpp
@@ -30,7 +30,7 @@ class TupFragReq {
friend class Dblqh;
friend class Dbtup;
public:
- STATIC_CONST( SignalLength = 14 );
+ STATIC_CONST( SignalLength = 17 );
private:
Uint32 userPtr;
Uint32 userRef;
@@ -38,7 +38,18 @@ private:
Uint32 tableId;
Uint32 noOfAttr;
Uint32 fragId;
- Uint32 todo[8];
+ Uint32 maxRowsLow;
+ Uint32 maxRowsHigh;
+ Uint32 minRowsLow;
+ Uint32 minRowsHigh;
+ Uint32 noOfNullAttr;
+ Uint32 schemaVersion;
+ Uint32 noOfKeyAttr;
+ Uint16 noOfNewAttr;
+ Uint16 noOfCharsets;
+ Uint32 checksumIndicator;
+ Uint32 noOfAttributeGroups;
+ Uint32 globalCheckpointIdIndicator;
};
class TupFragConf {
diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp
index 1413931035d..e67a0253096 100644
--- a/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/ndb/include/ndbapi/NdbDictionary.hpp
@@ -722,6 +722,20 @@ public:
*/
void setObjectType(Object::Type type);
+ /**
+ * Set/Get Maximum number of rows in table (only used to calculate
+ * number of partitions).
+ */
+ void setMaxRows(Uint64 maxRows);
+ Uint64 getMaxRows() const;
+
+ /**
+ * Set/Get Minimum number of rows in table (only used to calculate
+ * number of partitions).
+ */
+ void setMinRows(Uint64 minRows);
+ Uint64 getMinRows() const;
+
/** @} *******************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL