1 /*
2    Copyright (c) 2003, 2021, Oracle and/or its affiliates.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License, version 2.0,
6    as published by the Free Software Foundation.
7 
8    This program is also distributed with certain software (including
9    but not limited to OpenSSL) that is licensed under separate terms,
10    as designated in a particular file or component or in included license
11    documentation.  The authors of MySQL hereby grant you an additional
12    permission to link the program and your derivative works with the
13    separately licensed software that they have included with MySQL.
14 
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License, version 2.0, for more details.
19 
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23 */
24 
25 
26 #include <pc.hpp>
27 #define DBLQH_C
28 #include "Dblqh.hpp"
29 #include <ndb_limits.h>
30 #include "DblqhCommon.hpp"
31 
32 #define JAM_FILE_ID 452
33 
34 
35 #define DEBUG(x) { ndbout << "LQH::" << x << endl; }
36 
initData()37 void Dblqh::initData()
38 {
39 #ifdef ERROR_INSERT
40   c_master_node_id = RNIL;
41 #endif
42 
43   caddfragrecFileSize = ZADDFRAGREC_FILE_SIZE;
44   cgcprecFileSize = ZGCPREC_FILE_SIZE;
45   chostFileSize = MAX_NDB_NODES;
46   clcpFileSize = ZNO_CONCURRENT_LCP;
47   clfoFileSize = 0;
48   clogFileFileSize = 0;
49 
50   NdbLogPartInfo lpinfo(instance());
51   clogPartFileSize = lpinfo.partCount;
52 
53   cpageRefFileSize = ZPAGE_REF_FILE_SIZE;
54   cscanrecFileSize = 0;
55   ctabrecFileSize = 0;
56   ctcConnectrecFileSize = 0;
57   ctcNodeFailrecFileSize = MAX_NDB_NODES;
58   cTransactionDeadlockDetectionTimeout = 100;
59 
60   addFragRecord = 0;
61   gcpRecord = 0;
62   hostRecord = 0;
63   lcpRecord = 0;
64   logPartRecord = 0;
65   logFileRecord = 0;
66   logFileOperationRecord = 0;
67   logPageRecord = 0;
68   pageRefRecord = 0;
69   tablerec = 0;
70   tcConnectionrec = 0;
71   tcNodeFailRecord = 0;
72 
73   // Records with constant sizes
74 
75   cLqhTimeOutCount = 0;
76   cLqhTimeOutCheckCount = 0;
77   cpackedListIndex = 0;
78   m_backup_ptr = RNIL;
79   clogFileSize = 16;
80   cmaxLogFilesInPageZero = 40;
81   cmaxValidLogFilesInPageZero = cmaxLogFilesInPageZero - 1;
82 
83 #if defined VM_TRACE || defined ERROR_INSERT
84   cmaxLogFilesInPageZero_DUMP = 0;
85 #endif
86 
87    totalLogFiles = 0;
88    logFileInitDone = 0;
89    totallogMBytes = 0;
90    logMBytesInitDone = 0;
91    m_startup_report_frequency = 0;
92 
93   c_active_add_frag_ptr_i = RNIL;
94   for (Uint32 i = 0; i < 1024; i++) {
95     ctransidHash[i] = RNIL;
96   }//for
97 
98   c_last_force_lcp_time = 0;
99   c_free_mb_force_lcp_limit = 16;
100   c_free_mb_tail_problem_limit = 4;
101 
102   cTotalLqhKeyReqCount = 0;
103   c_max_redo_lag = 30; // seconds
104   c_max_redo_lag_counter = 3; // 3 strikes and you're out
105 
106   c_max_parallel_scans_per_frag = 32;
107 
108   c_lcpFragWatchdog.block = this;
109   c_lcpFragWatchdog.reset();
110   c_lcpFragWatchdog.thread_active = false;
111 
112   c_keyOverloads           = 0;
113   c_keyOverloadsTcNode     = 0;
114   c_keyOverloadsReaderApi  = 0;
115   c_keyOverloadsPeerNode   = 0;
116   c_keyOverloadsSubscriber = 0;
117   c_scanSlowDowns          = 0;
118 
119   c_fragmentsStarted = 0;
120   c_fragmentsStartedWithCopy = 0;
121 
122   c_fragCopyTable = 0;
123   c_fragCopyFrag = 0;
124   c_fragCopyRowsIns = 0;
125   c_fragCopyRowsDel = 0;
126   c_fragBytesCopied = 0;
127 
128   c_fragmentCopyStart = 0;
129   c_fragmentsCopied = 0;
130   c_totalCopyRowsIns = 0;
131   c_totalCopyRowsDel = 0;
132   c_totalBytesCopied = 0;
133 
134 }//Dblqh::initData()
135 
initRecords()136 void Dblqh::initRecords()
137 {
138   // Records with dynamic sizes
139   addFragRecord = (AddFragRecord*)allocRecord("AddFragRecord",
140 					      sizeof(AddFragRecord),
141 					      caddfragrecFileSize);
142 
143   gcpRecord = (GcpRecord*)allocRecord("GcpRecord",
144 				      sizeof(GcpRecord),
145 				      cgcprecFileSize);
146 
147   hostRecord = (HostRecord*)allocRecord("HostRecord",
148 					sizeof(HostRecord),
149 					chostFileSize);
150 
151   lcpRecord = (LcpRecord*)allocRecord("LcpRecord",
152 				      sizeof(LcpRecord),
153 				      clcpFileSize);
154 
155   for(Uint32 i = 0; i<clcpFileSize; i++){
156     new (&lcpRecord[i])LcpRecord();
157   }
158 
159   logPartRecord = (LogPartRecord*)allocRecord("LogPartRecord",
160 					      sizeof(LogPartRecord),
161 					      NDB_MAX_LOG_PARTS);
162 
163   logFileRecord = (LogFileRecord*)allocRecord("LogFileRecord",
164 					      sizeof(LogFileRecord),
165 					      clogFileFileSize);
166 
167   logFileOperationRecord = (LogFileOperationRecord*)
168     allocRecord("LogFileOperationRecord",
169 		sizeof(LogFileOperationRecord),
170 		clfoFileSize);
171 
172   {
173     AllocChunk chunks[16];
174     const Uint32 chunkcnt = allocChunks(chunks, 16, RG_FILE_BUFFERS,
175                                         clogPageFileSize, CFG_DB_REDO_BUFFER);
176 
177     {
178       Ptr<GlobalPage> pagePtr;
179       m_shared_page_pool.getPtr(pagePtr, chunks[0].ptrI);
180       logPageRecord = (LogPageRecord*)pagePtr.p;
181     }
182 
183     cfirstfreeLogPage = RNIL;
184     clogPageFileSize = 0;
185     clogPageCount = 0;
186     for (Int32 i = chunkcnt - 1; i >= 0; i--)
187     {
188       const Uint32 cnt = chunks[i].cnt;
189       ndbrequire(cnt != 0);
190 
191       Ptr<GlobalPage> pagePtr;
192       m_shared_page_pool.getPtr(pagePtr, chunks[i].ptrI);
193       LogPageRecord * base = (LogPageRecord*)pagePtr.p;
194       ndbrequire(base >= logPageRecord);
195       const Uint32 ptrI = Uint32(base - logPageRecord);
196 
197       for (Uint32 j = 0; j<cnt; j++)
198       {
199         refresh_watch_dog();
200         base[j].logPageWord[ZNEXT_PAGE] = ptrI + j + 1;
201         base[j].logPageWord[ZPOS_IN_FREE_LIST]= 1;
202         base[j].logPageWord[ZPOS_IN_WRITING]= 0;
203       }
204 
205       base[cnt-1].logPageWord[ZNEXT_PAGE] = cfirstfreeLogPage;
206       cfirstfreeLogPage = ptrI;
207 
208       clogPageCount += cnt;
209       if (ptrI + cnt > clogPageFileSize)
210         clogPageFileSize = ptrI + cnt;
211     }
212     cnoOfLogPages = clogPageCount;
213   }
214 
215 #ifndef NO_REDO_PAGE_CACHE
216   m_redo_page_cache.m_pool.set((RedoCacheLogPageRecord*)logPageRecord,
217                                clogPageFileSize);
218   m_redo_page_cache.m_hash.setSize(63);
219 
220   const Uint32 * base = (Uint32*)logPageRecord;
221   const RedoCacheLogPageRecord* tmp1 = (RedoCacheLogPageRecord*)logPageRecord;
222   ndbrequire(&base[ZPOS_PAGE_NO] == &tmp1->m_page_no);
223   ndbrequire(&base[ZPOS_PAGE_FILE_NO] == &tmp1->m_file_no);
224 #endif
225 
226 #ifndef NO_REDO_OPEN_FILE_CACHE
227   m_redo_open_file_cache.m_pool.set(logFileRecord, clogFileFileSize);
228 #endif
229 
230   pageRefRecord = (PageRefRecord*)allocRecord("PageRefRecord",
231 					      sizeof(PageRefRecord),
232 					      cpageRefFileSize);
233 
234   c_scanRecordPool.setSize(cscanrecFileSize);
235   c_scanTakeOverHash.setSize(64);
236 
237   tablerec = (Tablerec*)allocRecord("Tablerec",
238 				    sizeof(Tablerec),
239 				    ctabrecFileSize);
240 
241   tcConnectionrec = (TcConnectionrec*)allocRecord("TcConnectionrec",
242 						  sizeof(TcConnectionrec),
243 						  ctcConnectrecFileSize);
244 
245   m_commitAckMarkerPool.setSize(ctcConnectrecFileSize);
246   m_commitAckMarkerHash.setSize(1024);
247 
248   tcNodeFailRecord = (TcNodeFailRecord*)allocRecord("TcNodeFailRecord",
249 						    sizeof(TcNodeFailRecord),
250 						    ctcNodeFailrecFileSize);
251 
252   /*
253   ndbout << "FRAGREC SIZE = " << sizeof(Fragrecord) << endl;
254   ndbout << "TAB SIZE = " << sizeof(Tablerec) << endl;
255   ndbout << "GCP SIZE = " << sizeof(GcpRecord) << endl;
256   ndbout << "LCP SIZE = " << sizeof(LcpRecord) << endl;
257   ndbout << "LCPLOC SIZE = " << sizeof(LcpLocRecord) << endl;
258   ndbout << "LOGPART SIZE = " << sizeof(LogPartRecord) << endl;
259   ndbout << "LOGFILE SIZE = " << sizeof(LogFileRecord) << endl;
260   ndbout << "TC SIZE = " << sizeof(TcConnectionrec) << endl;
261   ndbout << "HOST SIZE = " << sizeof(HostRecord) << endl;
262   ndbout << "LFO SIZE = " << sizeof(LogFileOperationRecord) << endl;
263   ndbout << "PR SIZE = " << sizeof(PageRefRecord) << endl;
264   ndbout << "SCAN SIZE = " << sizeof(ScanRecord) << endl;
265 */
266 
267   // Initialize BAT for interface to file system
268   NewVARIABLE* bat = allocateBat(2);
269   bat[1].WA = &logPageRecord->logPageWord[0];
270   bat[1].nrr = clogPageFileSize;
271   bat[1].ClusterSize = sizeof(LogPageRecord);
272   bat[1].bits.q = ZTWOLOG_PAGE_SIZE;
273   bat[1].bits.v = 5;
274 }//Dblqh::initRecords()
275 
276 bool
getParam(const char * name,Uint32 * count)277 Dblqh::getParam(const char* name, Uint32* count)
278 {
279   if (name != NULL && count != NULL)
280   {
281     /* FragmentInfoPool
282      * We increase the size of the fragment info pool
283      * to handle fragmented SCANFRAGREQ signals from
284      * TC
285      */
286     if (strcmp(name, "FragmentInfoPool") == 0)
287     {
288       /* Worst case is every TC block sending
289        * a single fragmented request concurrently
290        * This could change in future if TCs can
291        * interleave fragments from different
292        * requests
293        */
294       const Uint32 TC_BLOCKS_PER_NODE = 1;
295       *count= ((MAX_NDB_NODES -1) * TC_BLOCKS_PER_NODE) + 10;
296       return true;
297     }
298   }
299   return false;
300 }
301 
Dblqh(Block_context & ctx,Uint32 instanceNumber)302 Dblqh::Dblqh(Block_context& ctx, Uint32 instanceNumber):
303   SimulatedBlock(DBLQH, ctx, instanceNumber),
304   m_reserved_scans(c_scanRecordPool),
305   c_lcp_waiting_fragments(c_fragment_pool),
306   c_lcp_restoring_fragments(c_fragment_pool),
307   c_lcp_complete_fragments(c_fragment_pool),
308   c_queued_lcp_frag_ord(c_fragment_pool),
309   m_commitAckMarkerHash(m_commitAckMarkerPool),
310   c_scanTakeOverHash(c_scanRecordPool)
311 {
312   BLOCK_CONSTRUCTOR(Dblqh);
313 
314   addRecSignal(GSN_PACKED_SIGNAL, &Dblqh::execPACKED_SIGNAL);
315   addRecSignal(GSN_DEBUG_SIG, &Dblqh::execDEBUG_SIG);
316   addRecSignal(GSN_ATTRINFO, &Dblqh::execATTRINFO);
317   addRecSignal(GSN_KEYINFO, &Dblqh::execKEYINFO);
318   addRecSignal(GSN_LQHKEYREQ, &Dblqh::execLQHKEYREQ);
319   addRecSignal(GSN_LQHKEYREF, &Dblqh::execLQHKEYREF);
320   addRecSignal(GSN_COMMIT, &Dblqh::execCOMMIT);
321   addRecSignal(GSN_COMPLETE, &Dblqh::execCOMPLETE);
322   addRecSignal(GSN_LQHKEYCONF, &Dblqh::execLQHKEYCONF);
323 #ifdef VM_TRACE
324   addRecSignal(GSN_TESTSIG, &Dblqh::execTESTSIG);
325 #endif
326   addRecSignal(GSN_CONTINUEB, &Dblqh::execCONTINUEB);
327   addRecSignal(GSN_START_RECREQ, &Dblqh::execSTART_RECREQ);
328   addRecSignal(GSN_START_RECCONF, &Dblqh::execSTART_RECCONF);
329   addRecSignal(GSN_EXEC_FRAGREQ, &Dblqh::execEXEC_FRAGREQ);
330   addRecSignal(GSN_EXEC_FRAGCONF, &Dblqh::execEXEC_FRAGCONF);
331   addRecSignal(GSN_EXEC_FRAGREF, &Dblqh::execEXEC_FRAGREF);
332   addRecSignal(GSN_START_EXEC_SR, &Dblqh::execSTART_EXEC_SR);
333   addRecSignal(GSN_EXEC_SRREQ, &Dblqh::execEXEC_SRREQ);
334   addRecSignal(GSN_EXEC_SRCONF, &Dblqh::execEXEC_SRCONF);
335 
336   addRecSignal(GSN_ALTER_TAB_REQ, &Dblqh::execALTER_TAB_REQ);
337 
338   addRecSignal(GSN_SIGNAL_DROPPED_REP, &Dblqh::execSIGNAL_DROPPED_REP, true);
339 
340   // Trigger signals, transit to from TUP
341   addRecSignal(GSN_CREATE_TRIG_IMPL_REQ, &Dblqh::execCREATE_TRIG_IMPL_REQ);
342   addRecSignal(GSN_CREATE_TRIG_IMPL_CONF, &Dblqh::execCREATE_TRIG_IMPL_CONF);
343   addRecSignal(GSN_CREATE_TRIG_IMPL_REF, &Dblqh::execCREATE_TRIG_IMPL_REF);
344 
345   addRecSignal(GSN_DROP_TRIG_IMPL_REQ, &Dblqh::execDROP_TRIG_IMPL_REQ);
346   addRecSignal(GSN_DROP_TRIG_IMPL_CONF, &Dblqh::execDROP_TRIG_IMPL_CONF);
347   addRecSignal(GSN_DROP_TRIG_IMPL_REF, &Dblqh::execDROP_TRIG_IMPL_REF);
348 
349   addRecSignal(GSN_BUILD_INDX_IMPL_REF, &Dblqh::execBUILD_INDX_IMPL_REF);
350   addRecSignal(GSN_BUILD_INDX_IMPL_CONF, &Dblqh::execBUILD_INDX_IMPL_CONF);
351 
352   addRecSignal(GSN_DUMP_STATE_ORD, &Dblqh::execDUMP_STATE_ORD);
353   addRecSignal(GSN_NODE_FAILREP, &Dblqh::execNODE_FAILREP);
354   addRecSignal(GSN_CHECK_LCP_STOP, &Dblqh::execCHECK_LCP_STOP);
355   addRecSignal(GSN_SEND_PACKED, &Dblqh::execSEND_PACKED, true);
356   addRecSignal(GSN_TUP_ATTRINFO, &Dblqh::execTUP_ATTRINFO);
357   addRecSignal(GSN_READ_CONFIG_REQ, &Dblqh::execREAD_CONFIG_REQ, true);
358   addRecSignal(GSN_LQHFRAGREQ, &Dblqh::execLQHFRAGREQ);
359   addRecSignal(GSN_LQHADDATTREQ, &Dblqh::execLQHADDATTREQ);
360   addRecSignal(GSN_TUP_ADD_ATTCONF, &Dblqh::execTUP_ADD_ATTCONF);
361   addRecSignal(GSN_TUP_ADD_ATTRREF, &Dblqh::execTUP_ADD_ATTRREF);
362   addRecSignal(GSN_ACCFRAGCONF, &Dblqh::execACCFRAGCONF);
363   addRecSignal(GSN_ACCFRAGREF, &Dblqh::execACCFRAGREF);
364   addRecSignal(GSN_TUPFRAGCONF, &Dblqh::execTUPFRAGCONF);
365   addRecSignal(GSN_TUPFRAGREF, &Dblqh::execTUPFRAGREF);
366   addRecSignal(GSN_TAB_COMMITREQ, &Dblqh::execTAB_COMMITREQ);
367   addRecSignal(GSN_ACCSEIZECONF, &Dblqh::execACCSEIZECONF);
368   addRecSignal(GSN_ACCSEIZEREF, &Dblqh::execACCSEIZEREF);
369   addRecSignal(GSN_READ_NODESCONF, &Dblqh::execREAD_NODESCONF);
370   addRecSignal(GSN_READ_NODESREF, &Dblqh::execREAD_NODESREF);
371   addRecSignal(GSN_STTOR, &Dblqh::execSTTOR);
372   addRecSignal(GSN_NDB_STTOR, &Dblqh::execNDB_STTOR);
373   addRecSignal(GSN_TUPSEIZECONF, &Dblqh::execTUPSEIZECONF);
374   addRecSignal(GSN_TUPSEIZEREF, &Dblqh::execTUPSEIZEREF);
375   addRecSignal(GSN_ACCKEYCONF, &Dblqh::execACCKEYCONF);
376   addRecSignal(GSN_ACCKEYREF, &Dblqh::execACCKEYREF);
377   addRecSignal(GSN_TUPKEYREF, &Dblqh::execTUPKEYREF);
378   addRecSignal(GSN_ABORT, &Dblqh::execABORT);
379   addRecSignal(GSN_ABORTREQ, &Dblqh::execABORTREQ);
380   addRecSignal(GSN_COMMITREQ, &Dblqh::execCOMMITREQ);
381   addRecSignal(GSN_COMPLETEREQ, &Dblqh::execCOMPLETEREQ);
382 #ifdef VM_TRACE
383   addRecSignal(GSN_MEMCHECKREQ, &Dblqh::execMEMCHECKREQ);
384 #endif
385   addRecSignal(GSN_SCAN_FRAGREQ, &Dblqh::execSCAN_FRAGREQ);
386   addRecSignal(GSN_SCAN_NEXTREQ, &Dblqh::execSCAN_NEXTREQ);
387   addRecSignal(GSN_NEXT_SCANCONF, &Dblqh::execNEXT_SCANCONF);
388   addRecSignal(GSN_NEXT_SCANREF, &Dblqh::execNEXT_SCANREF);
389   addRecSignal(GSN_COPY_FRAGREQ, &Dblqh::execCOPY_FRAGREQ);
390   addRecSignal(GSN_COPY_FRAGREF, &Dblqh::execCOPY_FRAGREF);
391   addRecSignal(GSN_COPY_FRAGCONF, &Dblqh::execCOPY_FRAGCONF);
392   addRecSignal(GSN_COPY_ACTIVEREQ, &Dblqh::execCOPY_ACTIVEREQ);
393   addRecSignal(GSN_LQH_TRANSREQ, &Dblqh::execLQH_TRANSREQ);
394   addRecSignal(GSN_TRANSID_AI, &Dblqh::execTRANSID_AI);
395   addRecSignal(GSN_INCL_NODEREQ, &Dblqh::execINCL_NODEREQ);
396   addRecSignal(GSN_LCP_PREPARE_REF, &Dblqh::execLCP_PREPARE_REF);
397   addRecSignal(GSN_LCP_PREPARE_CONF, &Dblqh::execLCP_PREPARE_CONF);
398   addRecSignal(GSN_END_LCPCONF, &Dblqh::execEND_LCPCONF);
399 
400   addRecSignal(GSN_EMPTY_LCP_REQ, &Dblqh::execEMPTY_LCP_REQ);
401   addRecSignal(GSN_LCP_FRAG_ORD, &Dblqh::execLCP_FRAG_ORD);
402 
403   addRecSignal(GSN_START_FRAGREQ, &Dblqh::execSTART_FRAGREQ);
404   addRecSignal(GSN_START_RECREF, &Dblqh::execSTART_RECREF);
405   addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ);
406   addRecSignal(GSN_FSOPENREF, &Dblqh::execFSOPENREF, true);
407   addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF);
408   addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF);
409   addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF);
410   addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF, true);
411   addRecSignal(GSN_FSREADCONF, &Dblqh::execFSREADCONF);
412   addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF, true);
413   addRecSignal(GSN_ACC_ABORTCONF, &Dblqh::execACC_ABORTCONF);
414   addRecSignal(GSN_TIME_SIGNAL,  &Dblqh::execTIME_SIGNAL);
415   addRecSignal(GSN_FSSYNCCONF,  &Dblqh::execFSSYNCCONF);
416   addRecSignal(GSN_REMOVE_MARKER_ORD, &Dblqh::execREMOVE_MARKER_ORD);
417 
418   addRecSignal(GSN_CREATE_TAB_REQ, &Dblqh::execCREATE_TAB_REQ);
419   addRecSignal(GSN_CREATE_TAB_REF, &Dblqh::execCREATE_TAB_REF);
420   addRecSignal(GSN_CREATE_TAB_CONF, &Dblqh::execCREATE_TAB_CONF);
421 
422   addRecSignal(GSN_PREP_DROP_TAB_REQ, &Dblqh::execPREP_DROP_TAB_REQ);
423   addRecSignal(GSN_DROP_TAB_REQ, &Dblqh::execDROP_TAB_REQ);
424   addRecSignal(GSN_DROP_TAB_REF, &Dblqh::execDROP_TAB_REF);
425   addRecSignal(GSN_DROP_TAB_CONF, &Dblqh::execDROP_TAB_CONF);
426 
427   addRecSignal(GSN_LQH_WRITELOG_REQ, &Dblqh::execLQH_WRITELOG_REQ);
428   addRecSignal(GSN_TUP_DEALLOCREQ, &Dblqh::execTUP_DEALLOCREQ);
429 
430   // TUX
431   addRecSignal(GSN_TUXFRAGCONF, &Dblqh::execTUXFRAGCONF);
432   addRecSignal(GSN_TUXFRAGREF, &Dblqh::execTUXFRAGREF);
433   addRecSignal(GSN_TUX_ADD_ATTRCONF, &Dblqh::execTUX_ADD_ATTRCONF);
434   addRecSignal(GSN_TUX_ADD_ATTRREF, &Dblqh::execTUX_ADD_ATTRREF);
435 
436   addRecSignal(GSN_READ_PSEUDO_REQ, &Dblqh::execREAD_PSEUDO_REQ);
437 
438   addRecSignal(GSN_DEFINE_BACKUP_REF, &Dblqh::execDEFINE_BACKUP_REF);
439   addRecSignal(GSN_DEFINE_BACKUP_CONF, &Dblqh::execDEFINE_BACKUP_CONF);
440 
441   addRecSignal(GSN_BACKUP_FRAGMENT_REF, &Dblqh::execBACKUP_FRAGMENT_REF);
442   addRecSignal(GSN_BACKUP_FRAGMENT_CONF, &Dblqh::execBACKUP_FRAGMENT_CONF);
443 
444   addRecSignal(GSN_RESTORE_LCP_REF, &Dblqh::execRESTORE_LCP_REF);
445   addRecSignal(GSN_RESTORE_LCP_CONF, &Dblqh::execRESTORE_LCP_CONF);
446 
447   addRecSignal(GSN_UPDATE_FRAG_DIST_KEY_ORD,
448 	       &Dblqh::execUPDATE_FRAG_DIST_KEY_ORD);
449 
450   addRecSignal(GSN_PREPARE_COPY_FRAG_REQ,
451 	       &Dblqh::execPREPARE_COPY_FRAG_REQ);
452 
453   addRecSignal(GSN_DROP_FRAG_REQ, &Dblqh::execDROP_FRAG_REQ);
454   addRecSignal(GSN_DROP_FRAG_REF, &Dblqh::execDROP_FRAG_REF);
455   addRecSignal(GSN_DROP_FRAG_CONF, &Dblqh::execDROP_FRAG_CONF);
456 
457   addRecSignal(GSN_SUB_GCP_COMPLETE_REP, &Dblqh::execSUB_GCP_COMPLETE_REP);
458   addRecSignal(GSN_FSWRITEREQ,
459                &Dblqh::execFSWRITEREQ);
460   addRecSignal(GSN_DBINFO_SCANREQ, &Dblqh::execDBINFO_SCANREQ);
461 
462   addRecSignal(GSN_FIRE_TRIG_REQ, &Dblqh::execFIRE_TRIG_REQ);
463 
464   addRecSignal(GSN_LCP_STATUS_CONF, &Dblqh::execLCP_STATUS_CONF);
465   addRecSignal(GSN_LCP_STATUS_REF, &Dblqh::execLCP_STATUS_REF);
466 
467   initData();
468 
469 #ifdef VM_TRACE
470   {
471     void* tmp[] = {
472       &addfragptr,
473       &fragptr,
474       &gcpPtr,
475       &lcpPtr,
476       &logPartPtr,
477       &logFilePtr,
478       &lfoPtr,
479       &logPagePtr,
480       &pageRefPtr,
481       &scanptr,
482       &tabptr,
483       &tcConnectptr,
484     };
485     init_globals_list(tmp, sizeof(tmp)/sizeof(tmp[0]));
486   }
487 #endif
488 
489 }//Dblqh::Dblqh()
490 
~Dblqh()491 Dblqh::~Dblqh()
492 {
493 #ifndef NO_REDO_PAGE_CACHE
494   m_redo_page_cache.m_pool.clear();
495 #endif
496 
497 #ifndef NO_REDO_OPEN_FILE_CACHE
498   m_redo_open_file_cache.m_pool.clear();
499 #endif
500 
501   // Records with dynamic sizes
502   deallocRecord((void **)&addFragRecord, "AddFragRecord",
503 		sizeof(AddFragRecord),
504 		caddfragrecFileSize);
505 
506   deallocRecord((void**)&gcpRecord,
507 		"GcpRecord",
508 		sizeof(GcpRecord),
509 		cgcprecFileSize);
510 
511   deallocRecord((void**)&hostRecord,
512 		"HostRecord",
513 		sizeof(HostRecord),
514 		chostFileSize);
515 
516   deallocRecord((void**)&lcpRecord,
517 		"LcpRecord",
518 		sizeof(LcpRecord),
519 		clcpFileSize);
520 
521   deallocRecord((void**)&logPartRecord,
522 		"LogPartRecord",
523 		sizeof(LogPartRecord),
524 		clogPartFileSize);
525 
526   deallocRecord((void**)&logFileRecord,
527 		"LogFileRecord",
528 		sizeof(LogFileRecord),
529 		clogFileFileSize);
530 
531   deallocRecord((void**)&logFileOperationRecord,
532 		"LogFileOperationRecord",
533 		sizeof(LogFileOperationRecord),
534 		clfoFileSize);
535 
536   deallocRecord((void**)&pageRefRecord,
537 		"PageRefRecord",
538 		sizeof(PageRefRecord),
539 		cpageRefFileSize);
540 
541 
542   deallocRecord((void**)&tablerec,
543 		"Tablerec",
544 		sizeof(Tablerec),
545 		ctabrecFileSize);
546 
547   deallocRecord((void**)&tcConnectionrec,
548 		"TcConnectionrec",
549 		sizeof(TcConnectionrec),
550 		ctcConnectrecFileSize);
551 
552   deallocRecord((void**)&tcNodeFailRecord,
553 		"TcNodeFailRecord",
554 		sizeof(TcNodeFailRecord),
555 		ctcNodeFailrecFileSize);
556 }//Dblqh::~Dblqh()
557 
558 BLOCK_FUNCTIONS(Dblqh)
559 
560