Commit 2eb5c010 authored by unknown's avatar unknown

bug#9961 more printouts

parent 67e2a864
...@@ -10334,6 +10334,14 @@ void Dbdih::crashSystemAtGcpStop(Signal* signal) ...@@ -10334,6 +10334,14 @@ void Dbdih::crashSystemAtGcpStop(Signal* signal)
file1Ptr.p->fileStatus, file1Ptr.p->fileType, file1Ptr.p->reqStatus file1Ptr.p->fileStatus, file1Ptr.p->fileType, file1Ptr.p->reqStatus
); );
signal->theData[0] = 404;
signal->theData[1] = file0Ptr.p->fileRef;
EXECUTE_DIRECT(NDBFS, GSN_DUMP_STATE_ORD, signal, 2);
signal->theData[0] = 404;
signal->theData[1] = file1Ptr.p->fileRef;
EXECUTE_DIRECT(NDBFS, GSN_DUMP_STATE_ORD, signal, 2);
ndbout_c("c_COPY_GCIREQ_Counter = %s", ndbout_c("c_COPY_GCIREQ_Counter = %s",
c_COPY_GCIREQ_Counter.getText()); c_COPY_GCIREQ_Counter.getText());
ndbout_c("c_COPY_TABREQ_Counter = %s", ndbout_c("c_COPY_TABREQ_Counter = %s",
......
...@@ -96,6 +96,7 @@ AsyncFile::AsyncFile() : ...@@ -96,6 +96,7 @@ AsyncFile::AsyncFile() :
theReportTo(0), theReportTo(0),
theMemoryChannelPtr(NULL) theMemoryChannelPtr(NULL)
{ {
m_current_request= m_last_request= 0;
} }
void void
...@@ -177,6 +178,7 @@ AsyncFile::run() ...@@ -177,6 +178,7 @@ AsyncFile::run()
endReq(); endReq();
return; return;
}//if }//if
m_current_request= request;
switch (request->action) { switch (request->action) {
case Request:: open: case Request:: open:
openReq(request); openReq(request);
...@@ -226,6 +228,8 @@ AsyncFile::run() ...@@ -226,6 +228,8 @@ AsyncFile::run()
abort(); abort();
break; break;
}//switch }//switch
m_last_request= request;
m_current_request= 0;
theReportTo->writeChannel(request); theReportTo->writeChannel(request);
}//while }//while
}//AsyncFile::run() }//AsyncFile::run()
...@@ -1031,3 +1035,60 @@ void printErrorAndFlags(Uint32 used_flags) { ...@@ -1031,3 +1035,60 @@ void printErrorAndFlags(Uint32 used_flags) {
} }
#endif #endif
NdbOut&
operator<<(NdbOut& out, const Request& req)
{
out << "[ Request: file: " << hex << req.file
<< " userRef: " << hex << req.theUserReference
<< " userData: " << dec << req.theUserPointer
<< " theFilePointer: " << req.theFilePointer
<< " action: ";
switch(req.action){
case Request::open:
out << "open";
break;
case Request::close:
out << "close";
break;
case Request::closeRemove:
out << "closeRemove";
break;
case Request::read: // Allways leave readv directly after
out << "read";
break;
case Request::readv:
out << "readv";
break;
case Request::write:// Allways leave writev directly after
out << "write";
break;
case Request::writev:
out << "writev";
break;
case Request::writeSync:// Allways leave writevSync directly after
out << "writeSync";
break;
// writeSync because SimblockAsyncFileSystem depends on it
case Request::writevSync:
out << "writevSync";
break;
case Request::sync:
out << "sync";
break;
case Request::end:
out << "end";
break;
case Request::append:
out << "append";
break;
case Request::rmrf:
out << "rmrf";
break;
default:
out << (Uint32)req.action;
break;
}
out << " ]";
return out;
}
...@@ -160,6 +160,7 @@ public: ...@@ -160,6 +160,7 @@ public:
Uint32 theTrace; Uint32 theTrace;
}; };
NdbOut& operator <<(NdbOut&, const Request&);
inline inline
void void
...@@ -173,6 +174,7 @@ Request::set(BlockReference userReference, ...@@ -173,6 +174,7 @@ Request::set(BlockReference userReference,
class AsyncFile class AsyncFile
{ {
friend class Ndbfs;
public: public:
AsyncFile(); AsyncFile();
~AsyncFile(); ~AsyncFile();
...@@ -188,6 +190,7 @@ public: ...@@ -188,6 +190,7 @@ public:
bool isOpen(); bool isOpen();
Filename theFileName; Filename theFileName;
Request *m_current_request, *m_last_request;
private: private:
void openReq(Request *request); void openReq(Request *request);
......
...@@ -68,7 +68,7 @@ class CircularIndex ...@@ -68,7 +68,7 @@ class CircularIndex
{ {
public: public:
inline CircularIndex( int start= 0,int size=256 ); inline CircularIndex( int start= 0,int size=256 );
operator int (); operator int () const;
CircularIndex& operator ++ (); CircularIndex& operator ++ ();
friend int full( const CircularIndex& write, const CircularIndex& read ); friend int full( const CircularIndex& write, const CircularIndex& read );
friend int empty( const CircularIndex& write, const CircularIndex& read ); friend int empty( const CircularIndex& write, const CircularIndex& read );
...@@ -77,7 +77,7 @@ private: ...@@ -77,7 +77,7 @@ private:
int theIndex; int theIndex;
}; };
inline CircularIndex::operator int () inline CircularIndex::operator int () const
{ {
return theIndex; return theIndex;
} }
......
...@@ -96,8 +96,20 @@ private: ...@@ -96,8 +96,20 @@ private:
NdbMutex* theMutexPtr; NdbMutex* theMutexPtr;
NdbCondition* theConditionPtr; NdbCondition* theConditionPtr;
template<class U>
friend NdbOut& operator<<(NdbOut& out, const MemoryChannel<U> & chn);
}; };
template <class T>
NdbOut& operator<<(NdbOut& out, const MemoryChannel<T> & chn)
{
NdbMutex_Lock(chn.theMutexPtr);
out << "[ theSize: " << chn.theSize
<< " theReadIndex: " << (int)chn.theReadIndex
<< " theWriteIndex: " << (int)chn.theWriteIndex << " ]";
NdbMutex_Unlock(chn.theMutexPtr);
return out;
}
template <class T> MemoryChannel<T>::MemoryChannel( int size): template <class T> MemoryChannel<T>::MemoryChannel( int size):
theSize(size), theSize(size),
......
...@@ -1006,6 +1006,30 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal) ...@@ -1006,6 +1006,30 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal)
} }
return; return;
} }
if(signal->theData[0] == 404)
{
ndbrequire(signal->getLength() == 2);
Uint32 file= signal->theData[1];
AsyncFile* openFile = theOpenFiles.find(file);
ndbrequire(openFile);
ndbout_c("File: %s %p", openFile->theFileName.c_str(), openFile);
Request* curr = openFile->m_current_request;
Request* last = openFile->m_last_request;
if(curr)
ndbout << "Current request: " << *curr << endl;
if(last)
ndbout << "Last request: " << *last << endl;
ndbout << "theReportTo " << *openFile->theReportTo << endl;
ndbout << "theMemoryChannelPtr" << *openFile->theMemoryChannelPtr << endl;
ndbout << "All files: " << endl;
for (unsigned i = 0; i < theFiles.size(); i++){
AsyncFile* file = theFiles[i];
ndbout_c("%2d (0x%x): %s", i,file, file->isOpen()?"OPEN":"CLOSED");
}
}
}//Ndbfs::execDUMP_STATE_ORD() }//Ndbfs::execDUMP_STATE_ORD()
...@@ -1016,3 +1040,4 @@ template class Vector<AsyncFile*>; ...@@ -1016,3 +1040,4 @@ template class Vector<AsyncFile*>;
template class Vector<OpenFiles::OpenFileItem>; template class Vector<OpenFiles::OpenFileItem>;
template class MemoryChannel<Request>; template class MemoryChannel<Request>;
template class Pool<Request>; template class Pool<Request>;
template NdbOut& operator<<(NdbOut&, const MemoryChannel<Request>&);
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