Commit 44c29ca3 authored by unknown's avatar unknown

ndb -

  make Dblqh use OM_AUTO_SYNC


storage/ndb/include/kernel/signaldata/FsOpenReq.hpp:
  make Dblqh us OM_AUTO_SYNC
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
  make Dblqh us OM_AUTO_SYNC
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  make Dblqh us OM_AUTO_SYNC
storage/ndb/src/kernel/vm/pc.hpp:
  remove unused #defines
parent 5ae954b1
...@@ -43,6 +43,7 @@ class FsOpenReq { ...@@ -43,6 +43,7 @@ class FsOpenReq {
friend class Lgman; friend class Lgman;
friend class Tsman; friend class Tsman;
friend class Restore; friend class Restore;
friend class Dblqh;
/** /**
* For printing * For printing
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <signaldata/LCP.hpp> #include <signaldata/LCP.hpp>
#include <signaldata/LqhTransConf.hpp> #include <signaldata/LqhTransConf.hpp>
#include <signaldata/LqhFrag.hpp> #include <signaldata/LqhFrag.hpp>
#include <signaldata/FsOpenReq.hpp>
// primary key is stored in TUP // primary key is stored in TUP
#include "../dbtup/Dbtup.hpp" #include "../dbtup/Dbtup.hpp"
...@@ -1515,11 +1516,6 @@ public: ...@@ -1515,11 +1516,6 @@ public:
/** /**
* This variable contains the last word written in the last page. * This variable contains the last word written in the last page.
*/ */
UintR logFilePagesToDiskWithoutSynch;
/**
* This variable keeps track of the number of pages written since
* last synch on this log file.
*/
LogFileStatus logFileStatus; LogFileStatus logFileStatus;
/** /**
* A reference to page zero in this file. * A reference to page zero in this file.
......
...@@ -12415,7 +12415,6 @@ void Dblqh::initFsopenconf(Signal* signal) ...@@ -12415,7 +12415,6 @@ void Dblqh::initFsopenconf(Signal* signal)
ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord); ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
logFilePtr.p->currentMbyte = 0; logFilePtr.p->currentMbyte = 0;
logFilePtr.p->filePosition = 0; logFilePtr.p->filePosition = 0;
logFilePtr.p->logFilePagesToDiskWithoutSynch = 0;
}//Dblqh::initFsopenconf() }//Dblqh::initFsopenconf()
/* ========================================================================= */ /* ========================================================================= */
...@@ -13062,14 +13061,16 @@ void Dblqh::initLogpage(Signal* signal) ...@@ -13062,14 +13061,16 @@ void Dblqh::initLogpage(Signal* signal)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
void Dblqh::openFileRw(Signal* signal, LogFileRecordPtr olfLogFilePtr) void Dblqh::openFileRw(Signal* signal, LogFileRecordPtr olfLogFilePtr)
{ {
FsOpenReq* req = (FsOpenReq*)signal->getDataPtrSend();
signal->theData[0] = cownref; signal->theData[0] = cownref;
signal->theData[1] = olfLogFilePtr.i; signal->theData[1] = olfLogFilePtr.i;
signal->theData[2] = olfLogFilePtr.p->fileName[0]; signal->theData[2] = olfLogFilePtr.p->fileName[0];
signal->theData[3] = olfLogFilePtr.p->fileName[1]; signal->theData[3] = olfLogFilePtr.p->fileName[1];
signal->theData[4] = olfLogFilePtr.p->fileName[2]; signal->theData[4] = olfLogFilePtr.p->fileName[2];
signal->theData[5] = olfLogFilePtr.p->fileName[3]; signal->theData[5] = olfLogFilePtr.p->fileName[3];
signal->theData[6] = ZOPEN_READ_WRITE; signal->theData[6] = ZOPEN_READ_WRITE | FsOpenReq::OM_AUTOSYNC;
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, 7, JBA); req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord);
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
}//Dblqh::openFileRw() }//Dblqh::openFileRw()
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
...@@ -13080,14 +13081,16 @@ void Dblqh::openFileRw(Signal* signal, LogFileRecordPtr olfLogFilePtr) ...@@ -13080,14 +13081,16 @@ void Dblqh::openFileRw(Signal* signal, LogFileRecordPtr olfLogFilePtr)
void Dblqh::openLogfileInit(Signal* signal) void Dblqh::openLogfileInit(Signal* signal)
{ {
logFilePtr.p->logFileStatus = LogFileRecord::OPENING_INIT; logFilePtr.p->logFileStatus = LogFileRecord::OPENING_INIT;
FsOpenReq* req = (FsOpenReq*)signal->getDataPtrSend();
signal->theData[0] = cownref; signal->theData[0] = cownref;
signal->theData[1] = logFilePtr.i; signal->theData[1] = logFilePtr.i;
signal->theData[2] = logFilePtr.p->fileName[0]; signal->theData[2] = logFilePtr.p->fileName[0];
signal->theData[3] = logFilePtr.p->fileName[1]; signal->theData[3] = logFilePtr.p->fileName[1];
signal->theData[4] = logFilePtr.p->fileName[2]; signal->theData[4] = logFilePtr.p->fileName[2];
signal->theData[5] = logFilePtr.p->fileName[3]; signal->theData[5] = logFilePtr.p->fileName[3];
signal->theData[6] = 0x302; signal->theData[6] = 0x302 | FsOpenReq::OM_AUTOSYNC;
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, 7, JBA); req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord);
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
}//Dblqh::openLogfileInit() }//Dblqh::openLogfileInit()
/* OPEN FOR READ/WRITE, DO CREATE AND DO TRUNCATE FILE */ /* OPEN FOR READ/WRITE, DO CREATE AND DO TRUNCATE FILE */
...@@ -13114,14 +13117,16 @@ void Dblqh::openNextLogfile(Signal* signal) ...@@ -13114,14 +13117,16 @@ void Dblqh::openNextLogfile(Signal* signal)
return; return;
}//if }//if
onlLogFilePtr.p->logFileStatus = LogFileRecord::OPENING_WRITE_LOG; onlLogFilePtr.p->logFileStatus = LogFileRecord::OPENING_WRITE_LOG;
FsOpenReq* req = (FsOpenReq*)signal->getDataPtrSend();
signal->theData[0] = cownref; signal->theData[0] = cownref;
signal->theData[1] = onlLogFilePtr.i; signal->theData[1] = onlLogFilePtr.i;
signal->theData[2] = onlLogFilePtr.p->fileName[0]; signal->theData[2] = onlLogFilePtr.p->fileName[0];
signal->theData[3] = onlLogFilePtr.p->fileName[1]; signal->theData[3] = onlLogFilePtr.p->fileName[1];
signal->theData[4] = onlLogFilePtr.p->fileName[2]; signal->theData[4] = onlLogFilePtr.p->fileName[2];
signal->theData[5] = onlLogFilePtr.p->fileName[3]; signal->theData[5] = onlLogFilePtr.p->fileName[3];
signal->theData[6] = 2; signal->theData[6] = 2 | FsOpenReq::OM_AUTOSYNC;
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, 7, JBA); req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord);
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
}//if }//if
}//Dblqh::openNextLogfile() }//Dblqh::openNextLogfile()
...@@ -16138,15 +16143,8 @@ void Dblqh::completedLogPage(Signal* signal, Uint32 clpType, Uint32 place) ...@@ -16138,15 +16143,8 @@ void Dblqh::completedLogPage(Signal* signal, Uint32 clpType, Uint32 place)
signal->theData[0] = logFilePtr.p->fileRef; signal->theData[0] = logFilePtr.p->fileRef;
signal->theData[1] = cownref; signal->theData[1] = cownref;
signal->theData[2] = lfoPtr.i; signal->theData[2] = lfoPtr.i;
logFilePtr.p->logFilePagesToDiskWithoutSynch += twlpNoPages;
if (twlpType == ZLAST_WRITE_IN_FILE) { if (twlpType == ZLAST_WRITE_IN_FILE) {
jam(); jam();
logFilePtr.p->logFilePagesToDiskWithoutSynch = 0;
signal->theData[3] = ZLIST_OF_MEM_PAGES_SYNCH;
} else if (logFilePtr.p->logFilePagesToDiskWithoutSynch >
MAX_REDO_PAGES_WITHOUT_SYNCH) {
jam();
logFilePtr.p->logFilePagesToDiskWithoutSynch = 0;
signal->theData[3] = ZLIST_OF_MEM_PAGES_SYNCH; signal->theData[3] = ZLIST_OF_MEM_PAGES_SYNCH;
} else { } else {
jam(); jam();
......
...@@ -163,17 +163,10 @@ ...@@ -163,17 +163,10 @@
#define NO_OF_FRAGS_PER_CHUNK 4 #define NO_OF_FRAGS_PER_CHUNK 4
#define LOG_NO_OF_FRAGS_PER_CHUNK 2 #define LOG_NO_OF_FRAGS_PER_CHUNK 2
/**
* Page Header Size for pages
*/
#define ZPAGE_HEADER_SIZE 32
#define ZPAGE_FRAG_PAGE_ID_POS 4 /* POSITION OF FRAG PAGE ID WHEN USED*/
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
// To avoid synching too big chunks at a time we synch after writing // To avoid synching too big chunks at a time we synch after writing
// a certain number of data/UNDO pages. (e.g. 2 MBytes). // a certain number of data/UNDO pages. (e.g. 2 MBytes).
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
#define MAX_PAGES_WITHOUT_SYNCH 64
#define MAX_REDO_PAGES_WITHOUT_SYNCH 32 #define MAX_REDO_PAGES_WITHOUT_SYNCH 32
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment