27 #include <Properties.hpp>
28 #include <Configuration.hpp>
35 c_backups(c_backupPool)
39 c_masterNodeId = getOwnNodeId();
42 addRecSignal(GSN_READ_CONFIG_REQ, &Backup::execREAD_CONFIG_REQ);
43 addRecSignal(GSN_STTOR, &Backup::execSTTOR);
45 addRecSignal(GSN_READ_NODESCONF, &Backup::execREAD_NODESCONF);
46 addRecSignal(GSN_NODE_FAILREP, &Backup::execNODE_FAILREP);
47 addRecSignal(GSN_INCL_NODEREQ, &Backup::execINCL_NODEREQ);
48 addRecSignal(GSN_CONTINUEB, &Backup::execCONTINUEB);
49 addRecSignal(GSN_READ_CONFIG_REQ, &Backup::execREAD_CONFIG_REQ,
true);
53 addRecSignal(GSN_SCAN_FRAGREF, &Backup::execSCAN_FRAGREF);
54 addRecSignal(GSN_SCAN_FRAGCONF, &Backup::execSCAN_FRAGCONF);
61 addRecSignal(GSN_GET_TABINFOREF, &Backup::execGET_TABINFOREF);
62 addRecSignal(GSN_GET_TABINFO_CONF, &Backup::execGET_TABINFO_CONF);
67 addRecSignal(GSN_DROP_TRIG_IMPL_REF, &Backup::execDROP_TRIG_IMPL_REF);
68 addRecSignal(GSN_DROP_TRIG_IMPL_CONF, &Backup::execDROP_TRIG_IMPL_CONF);
71 addRecSignal(GSN_DIH_SCAN_GET_NODES_CONF,
72 &Backup::execDIH_SCAN_GET_NODES_CONF);
75 addRecSignal(GSN_FSOPENCONF, &Backup::execFSOPENCONF);
77 addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF,
true);
78 addRecSignal(GSN_FSCLOSECONF, &Backup::execFSCLOSECONF);
80 addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF,
true);
81 addRecSignal(GSN_FSAPPENDCONF, &Backup::execFSAPPENDCONF);
83 addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF,
true);
91 addRecSignal(GSN_DEFINE_BACKUP_REF, &Backup::execDEFINE_BACKUP_REF);
92 addRecSignal(GSN_DEFINE_BACKUP_CONF, &Backup::execDEFINE_BACKUP_CONF);
95 addRecSignal(GSN_START_BACKUP_REF, &Backup::execSTART_BACKUP_REF);
96 addRecSignal(GSN_START_BACKUP_CONF, &Backup::execSTART_BACKUP_CONF);
99 addRecSignal(GSN_BACKUP_FRAGMENT_REF, &Backup::execBACKUP_FRAGMENT_REF);
100 addRecSignal(GSN_BACKUP_FRAGMENT_CONF, &Backup::execBACKUP_FRAGMENT_CONF);
102 addRecSignal(GSN_BACKUP_FRAGMENT_COMPLETE_REP,
103 &Backup::execBACKUP_FRAGMENT_COMPLETE_REP);
106 addRecSignal(GSN_STOP_BACKUP_REF, &Backup::execSTOP_BACKUP_REF);
107 addRecSignal(GSN_STOP_BACKUP_CONF, &Backup::execSTOP_BACKUP_CONF);
112 addRecSignal(GSN_UTIL_SEQUENCE_REF, &Backup::execUTIL_SEQUENCE_REF);
113 addRecSignal(GSN_UTIL_SEQUENCE_CONF, &Backup::execUTIL_SEQUENCE_CONF);
115 addRecSignal(GSN_WAIT_GCP_REF, &Backup::execWAIT_GCP_REF);
117 addRecSignal(GSN_BACKUP_LOCK_TAB_CONF, &Backup::execBACKUP_LOCK_TAB_CONF);
118 addRecSignal(GSN_BACKUP_LOCK_TAB_REF, &Backup::execBACKUP_LOCK_TAB_REF);
124 addRecSignal(GSN_BACKUP_CONF, &Backup::execBACKUP_CONF);
125 addRecSignal(GSN_BACKUP_ABORT_REP, &Backup::execBACKUP_ABORT_REP);
126 addRecSignal(GSN_BACKUP_COMPLETE_REP, &Backup::execBACKUP_COMPLETE_REP);
129 addRecSignal(GSN_END_LCPREQ, &Backup::execEND_LCPREQ);
131 addRecSignal(GSN_DBINFO_SCANREQ, &Backup::execDBINFO_SCANREQ);
147 Uint32 ref = req->senderRef;
148 Uint32 senderData = req->senderData;
149 ndbrequire(req->noOfParameters == 0);
152 m_ctx.m_config.getOwnConfigIterator();
155 c_defaults.m_disk_write_speed = 10 * (1024 * 1024);
156 c_defaults.m_disk_write_speed_sr = 100 * (1024 * 1024);
157 c_defaults.m_disk_synch_size = 4 * (1024 * 1024);
158 c_defaults.m_o_direct =
true;
160 Uint32 noBackups = 0, noTables = 0, noAttribs = 0, noFrags = 0;
161 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS,
162 &c_defaults.m_diskless));
163 ndb_mgm_get_int_parameter(p, CFG_DB_O_DIRECT,
164 &c_defaults.m_o_direct);
165 ndb_mgm_get_int_parameter(p, CFG_DB_CHECKPOINT_SPEED_SR,
166 &c_defaults.m_disk_write_speed_sr);
167 ndb_mgm_get_int_parameter(p, CFG_DB_CHECKPOINT_SPEED,
168 &c_defaults.m_disk_write_speed);
169 ndb_mgm_get_int_parameter(p, CFG_DB_DISK_SYNCH_SIZE,
170 &c_defaults.m_disk_synch_size);
171 ndb_mgm_get_int_parameter(p, CFG_DB_COMPRESSED_BACKUP,
172 &c_defaults.m_compressed_backup);
173 ndb_mgm_get_int_parameter(p, CFG_DB_COMPRESSED_LCP,
174 &c_defaults.m_compressed_lcp);
176 m_backup_report_frequency = 0;
177 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_REPORT_FREQUENCY,
178 &m_backup_report_frequency);
184 c_defaults.m_disk_write_speed /= (4 * 10);
185 c_defaults.m_disk_write_speed_sr /= (4 * 10);
187 ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups);
189 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables));
190 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs));
191 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_FRAG_CONNECT, &noFrags));
195 c_nodePool.setSize(MAX_NDB_NODES);
196 c_backupPool.setSize(noBackups + 1);
197 c_backupFilePool.setSize(3 * noBackups + 1);
198 c_tablePool.setSize(noBackups * noTables + 1);
199 c_triggerPool.setSize(noBackups * 3 * noTables);
200 c_fragmentPool.setSize(noBackups * noFrags + 1);
202 Uint32 szDataBuf = (2 * 1024 * 1024);
203 Uint32 szLogBuf = (2 * 1024 * 1024);
204 Uint32 szWrite = 32768, maxWriteSize = (256 * 1024);
205 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_DATA_BUFFER_MEM, &szDataBuf);
206 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_LOG_BUFFER_MEM, &szLogBuf);
207 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_WRITE_SIZE, &szWrite);
208 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MAX_WRITE_SIZE, &maxWriteSize);
210 c_defaults.m_logBufferSize = szLogBuf;
211 c_defaults.m_dataBufferSize = szDataBuf;
212 c_defaults.m_minWriteSize = szWrite;
213 c_defaults.m_maxWriteSize = maxWriteSize;
214 c_defaults.m_lcp_buffer_size = szDataBuf;
217 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MEM, &szMem);
218 Uint32 noPages = (szMem + c_defaults.m_lcp_buffer_size +
sizeof(Page32) - 1)
222 c_pagePool.setSize(noPages + NO_OF_PAGES_META_FILE + 2,
true);
227 while(tables.seize(ptr)){
228 new (ptr.p) Table(c_fragmentPool);
236 while(ops.seize(ptr)){
245 while(recs.seize(ptr)){
246 new (ptr.p) BackupRecord(*
this, c_tablePool,
247 c_backupFilePool, c_triggerPool);
255 ndbrequire(c_pagePool.seizeId(p, 0));
256 c_startOfPages = (Uint32 *)p.p;
257 c_pagePool.release(p);
260 bat[0].WA = c_startOfPages;
261 bat[0].nrr = c_pagePool.getSize()*
sizeof(Page32)/
sizeof(Uint32);
265 conf->senderRef = reference();
266 conf->senderData = senderData;
267 sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
268 ReadConfigConf::SignalLength, JBB);