22 #include <SimulatedBlock.hpp>
26 #include <DLFifoList.hpp>
27 #include <KeyTable.hpp>
28 #include <DLHashTable.hpp>
29 #include <NodeBitmask.hpp>
30 #include "diskpage.hpp"
31 #include <signaldata/GetTabInfo.hpp>
34 #include <SLFifoList.hpp>
35 #include <SafeMutex.hpp>
46 void execSTTOR(
Signal* signal);
48 void execREAD_CONFIG_REQ(
Signal* signal);
49 void execDUMP_STATE_ORD(
Signal* signal);
50 void execDBINFO_SCANREQ(
Signal* signal);
51 void execCONTINUEB(
Signal* signal);
52 void execNODE_FAILREP(
Signal* signal);
54 void execCREATE_FILE_IMPL_REQ(
Signal* signal);
55 void execCREATE_FILEGROUP_IMPL_REQ(
Signal* signal);
56 void execDROP_FILE_IMPL_REQ(
Signal* signal);
57 void execDROP_FILEGROUP_IMPL_REQ(
Signal* signal);
59 void execFSWRITEREQ(
Signal*);
60 void execFSWRITEREF(
Signal*);
61 void execFSWRITECONF(
Signal*);
63 void execFSOPENREF(
Signal*);
64 void execFSOPENCONF(
Signal*);
66 void execFSCLOSEREF(
Signal*);
67 void execFSCLOSECONF(
Signal*);
69 void execFSREADREF(
Signal*);
72 void execLCP_FRAG_ORD(
Signal*);
73 void execEND_LCP_REQ(
Signal*);
76 void execSTART_RECREQ(
Signal*);
79 void execGET_TABINFOREQ(
Signal*);
83 GetTabInfoRef::ErrorCode errorCode);
111 Uint32 m_logfile_group_ptr_i;
127 ,FS_OUTSTANDING = 0x100
128 ,FS_MOVE_NEXT = 0x200
133 Uint32 m_outstanding;
139 Uint32 m_logfile_group_id;
140 Uint32 m_logfile_group_version;
160 bool operator== (
const Buffer_idx& bi)
const {
161 return (m_ptr_i == bi.m_ptr_i && m_idx == bi.m_idx);
173 Uint32 m_logfile_group_id;
177 Uint16 m_outstanding_fs;
178 Uint32 m_next_reply_ptr_i;
180 enum Logfile_group_state
184 ,LG_SEARCHING = 0x004
185 ,LG_EXEC_THREAD = 0x008
186 ,LG_READ_THREAD = 0x010
187 ,LG_FORCE_SYNC_THREAD = 0x020
188 ,LG_SYNC_WAITERS_THREAD = 0x040
189 ,LG_CUT_LOG_THREAD = 0x080
190 ,LG_WAITERS_THREAD = 0x100
191 ,LG_FLUSH_THREAD = 0x200
196 static const Uint32 LG_THREAD_MASK = Logfile_group::LG_FORCE_SYNC_THREAD |
197 Logfile_group::LG_SYNC_WAITERS_THREAD |
198 Logfile_group::LG_CUT_LOG_THREAD |
199 Logfile_group::LG_WAITERS_THREAD |
200 Logfile_group::LG_FLUSH_THREAD;
203 Uint64 m_last_sync_req_lsn;
204 Uint64 m_last_synced_lsn;
205 Uint64 m_max_sync_req_lsn;
207 Uint64 m_last_read_lsn;
208 Uint64 m_last_lcp_lsn;
214 Uint64 m_free_file_words;
219 Uint32 m_total_buffer_words;
220 Uint32 m_free_buffer_words;
221 Uint32 m_callback_buffer_words;
237 Uint32 hashValue()
const {
240 bool equal(
const Logfile_group&
rec)
const {
241 return key == rec.key;
255 CallbackEntry m_callbackEntry[COUNT_CALLBACKS];
256 CallbackTable m_callbackTable;
268 int alloc_log_space(Uint32 logfile_ref, Uint32 words);
269 int free_log_space(Uint32 logfile_ref, Uint32 words);
271 Undofile_pool m_file_pool;
272 Logfile_group_pool m_logfile_group_pool;
273 Log_waiter_pool m_log_waiter_pool;
275 Page_map::DataBufferPool m_data_buffer_pool;
279 Logfile_group_list m_logfile_group_list;
280 Logfile_group_hash m_logfile_group_hash;
281 Uint32 m_end_lcp_senderdata;
284 void client_lock(BlockNumber
block,
int line);
285 void client_unlock(BlockNumber
block,
int line);
293 Uint32 next_page(Logfile_group* ptrP, Uint32
i);
299 void endlcp_callback(
Signal*, Uint32, Uint32);
304 Uint32 pageId, Uint32 pages);
309 void init_run_undo_log(
Signal*);
312 Uint32 pageId, Uint32 pages);
314 void execute_undo_record(
Signal*);
315 const Uint32* get_next_undo_record(Uint64*
lsn);
316 void stop_run_undo_log(
Signal* signal);
319 bool find_file_by_id(
Ptr<Undofile>&, Undofile_list::Head&, Uint32
id);
330 Uint32 ref, Uint32 data);
338 DEBUG_OUT_DEFINES(LGMAN);
340 Uint32 m_logfile_group_id;
375 Uint64 add_entry(
const void*, Uint32 len);
376 Uint64 add_entry(
const Change*, Uint32 cnt);
379 Uint64 add_entry(
Local_key, Uint32 off, Uint32 change);
390 int alloc_log_space(Uint32 words) {
391 return m_lgman->alloc_log_space(m_logfile_group_id, words);
394 int free_log_space(Uint32 words) {
395 return m_lgman->free_log_space(m_logfile_group_id, words);
398 void exec_lcp_frag_ord(
Signal* signal) {