Commit 0ebabd84 authored by unknown's avatar unknown

Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.0

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
parents 4a2b181f e7709f71
...@@ -14622,6 +14622,8 @@ void Dblqh::execSr(Signal* signal) ...@@ -14622,6 +14622,8 @@ void Dblqh::execSr(Signal* signal)
LogFileRecordPtr nextLogFilePtr; LogFileRecordPtr nextLogFilePtr;
LogPageRecordPtr tmpLogPagePtr; LogPageRecordPtr tmpLogPagePtr;
Uint32 logWord; Uint32 logWord;
Uint32 line;
const char * crash_msg = 0;
jamEntry(); jamEntry();
logPartPtr.i = signal->theData[0]; logPartPtr.i = signal->theData[0];
...@@ -14832,8 +14834,14 @@ void Dblqh::execSr(Signal* signal) ...@@ -14832,8 +14834,14 @@ void Dblqh::execSr(Signal* signal)
/* PLACE THAN IN THE FIRST PAGE OF A NEW FILE IN THE FIRST POSITION AFTER THE*/ /* PLACE THAN IN THE FIRST PAGE OF A NEW FILE IN THE FIRST POSITION AFTER THE*/
/* HEADER. */ /* HEADER. */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
ndbrequire(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] == if (unlikely(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] !=
(ZPAGE_HEADER_SIZE + ZPOS_NO_FD)); (ZPAGE_HEADER_SIZE + ZPOS_NO_FD)))
{
line = __LINE__;
logWord = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX];
crash_msg = "ZFD_TYPE at incorrect position!";
goto crash;
}
{ {
Uint32 noFdDescriptors = Uint32 noFdDescriptors =
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD]; logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD];
...@@ -14870,19 +14878,10 @@ void Dblqh::execSr(Signal* signal) ...@@ -14870,19 +14878,10 @@ void Dblqh::execSr(Signal* signal)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* SEND A SIGNAL TO THE SIGNAL LOG AND THEN CRASH THE SYSTEM. */ /* SEND A SIGNAL TO THE SIGNAL LOG AND THEN CRASH THE SYSTEM. */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
signal->theData[0] = RNIL; line = __LINE__;
signal->theData[1] = logPartPtr.i; logWord = ZNEXT_MBYTE_TYPE;
Uint32 tmp = logFilePtr.p->fileName[3]; crash_msg = "end of log wo/ having found last GCI";
tmp = (tmp >> 8) & 0xff;// To get the Directory, DXX. goto crash;
signal->theData[2] = tmp;
signal->theData[3] = logFilePtr.p->fileNo;
signal->theData[4] = logFilePtr.p->currentFilepage;
signal->theData[5] = logFilePtr.p->currentMbyte;
signal->theData[6] = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX];
signal->theData[7] = ~0;
signal->theData[8] = __LINE__;
sendSignal(cownref, GSN_DEBUG_SIG, signal, 9, JBA);
return;
}//if }//if
}//if }//if
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -14937,6 +14936,19 @@ void Dblqh::execSr(Signal* signal) ...@@ -14937,6 +14936,19 @@ void Dblqh::execSr(Signal* signal)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* SEND A SIGNAL TO THE SIGNAL LOG AND THEN CRASH THE SYSTEM. */ /* SEND A SIGNAL TO THE SIGNAL LOG AND THEN CRASH THE SYSTEM. */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
line = __LINE__;
crash_msg = "Invalid logword";
goto crash;
break;
}//switch
/*---------------------------------------------------------------------------*/
// We continue to execute log records until we find a proper one to execute or
// that we reach a new page.
/*---------------------------------------------------------------------------*/
} while (1);
return;
crash:
signal->theData[0] = RNIL; signal->theData[0] = RNIL;
signal->theData[1] = logPartPtr.i; signal->theData[1] = logPartPtr.i;
Uint32 tmp = logFilePtr.p->fileName[3]; Uint32 tmp = logFilePtr.p->fileName[3];
...@@ -14947,16 +14959,22 @@ void Dblqh::execSr(Signal* signal) ...@@ -14947,16 +14959,22 @@ void Dblqh::execSr(Signal* signal)
signal->theData[5] = logFilePtr.p->currentFilepage; signal->theData[5] = logFilePtr.p->currentFilepage;
signal->theData[6] = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX]; signal->theData[6] = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX];
signal->theData[7] = logWord; signal->theData[7] = logWord;
signal->theData[8] = __LINE__; signal->theData[8] = line;
sendSignal(cownref, GSN_DEBUG_SIG, signal, 9, JBA);
return; char buf[255];
break; BaseString::snprintf(buf, sizeof(buf),
}//switch "Error while reading REDO log. from %d\n"
/*---------------------------------------------------------------------------*/ "D=%d, F=%d Mb=%d FP=%d W1=%d W2=%d : %s",
// We continue to execute log records until we find a proper one to execute or signal->theData[8],
// that we reach a new page. signal->theData[2],
/*---------------------------------------------------------------------------*/ signal->theData[3],
} while (1); signal->theData[4],
signal->theData[5],
signal->theData[6],
signal->theData[7],
crash_msg ? crash_msg : "");
progError(__LINE__, NDBD_EXIT_SR_REDOLOG, buf);
}//Dblqh::execSr() }//Dblqh::execSr()
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -14972,8 +14990,8 @@ void Dblqh::execDEBUG_SIG(Signal* signal) ...@@ -14972,8 +14990,8 @@ void Dblqh::execDEBUG_SIG(Signal* signal)
UintR tdebug; UintR tdebug;
jamEntry(); jamEntry();
logPagePtr.i = signal->theData[0]; //logPagePtr.i = signal->theData[0];
tdebug = logPagePtr.p->logPageWord[0]; //tdebug = logPagePtr.p->logPageWord[0];
char buf[100]; char buf[100];
BaseString::snprintf(buf, 100, BaseString::snprintf(buf, 100,
......
...@@ -476,6 +476,8 @@ int NdbScanOperation::nextResultImpl(bool fetchAllowed, bool forceSend) ...@@ -476,6 +476,8 @@ int NdbScanOperation::nextResultImpl(bool fetchAllowed, bool forceSend)
idx = m_current_api_receiver; idx = m_current_api_receiver;
last = m_api_receivers_count; last = m_api_receivers_count;
Uint32 timeout = tp->m_waitfor_timeout;
do { do {
if(theError.code){ if(theError.code){
setErrorCode(theError.code); setErrorCode(theError.code);
...@@ -502,7 +504,7 @@ int NdbScanOperation::nextResultImpl(bool fetchAllowed, bool forceSend) ...@@ -502,7 +504,7 @@ int NdbScanOperation::nextResultImpl(bool fetchAllowed, bool forceSend)
*/ */
theNdb->theImpl->theWaiter.m_node = nodeId; theNdb->theImpl->theWaiter.m_node = nodeId;
theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; theNdb->theImpl->theWaiter.m_state = WAIT_SCAN;
int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); int return_code = theNdb->receiveResponse(3*timeout);
if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) {
continue; continue;
} else { } else {
...@@ -1365,6 +1367,7 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed, ...@@ -1365,6 +1367,7 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed,
return -1; return -1;
Uint32 seq = theNdbCon->theNodeSequence; Uint32 seq = theNdbCon->theNodeSequence;
Uint32 nodeId = theNdbCon->theDBnode; Uint32 nodeId = theNdbCon->theDBnode;
Uint32 timeout = tp->m_waitfor_timeout;
if(seq == tp->getNodeSequence(nodeId) && if(seq == tp->getNodeSequence(nodeId) &&
!send_next_scan_ordered(s_idx, forceSend)){ !send_next_scan_ordered(s_idx, forceSend)){
Uint32 tmp = m_sent_receivers_count; Uint32 tmp = m_sent_receivers_count;
...@@ -1372,7 +1375,7 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed, ...@@ -1372,7 +1375,7 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed,
while(m_sent_receivers_count > 0 && !theError.code){ while(m_sent_receivers_count > 0 && !theError.code){
theNdb->theImpl->theWaiter.m_node = nodeId; theNdb->theImpl->theWaiter.m_node = nodeId;
theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; theNdb->theImpl->theWaiter.m_state = WAIT_SCAN;
int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); int return_code = theNdb->receiveResponse(3*timeout);
if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) {
continue; continue;
} }
...@@ -1513,6 +1516,8 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ ...@@ -1513,6 +1516,8 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){
return -1; return -1;
} }
Uint32 timeout = tp->m_waitfor_timeout;
/** /**
* Wait for outstanding * Wait for outstanding
*/ */
...@@ -1520,7 +1525,7 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ ...@@ -1520,7 +1525,7 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){
{ {
theNdb->theImpl->theWaiter.m_node = nodeId; theNdb->theImpl->theWaiter.m_node = nodeId;
theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; theNdb->theImpl->theWaiter.m_state = WAIT_SCAN;
int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); int return_code = theNdb->receiveResponse(3*timeout);
switch(return_code){ switch(return_code){
case 0: case 0:
break; break;
...@@ -1590,7 +1595,7 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ ...@@ -1590,7 +1595,7 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){
{ {
theNdb->theImpl->theWaiter.m_node = nodeId; theNdb->theImpl->theWaiter.m_node = nodeId;
theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; theNdb->theImpl->theWaiter.m_state = WAIT_SCAN;
int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); int return_code = theNdb->receiveResponse(3*timeout);
switch(return_code){ switch(return_code){
case 0: case 0:
break; break;
......
...@@ -723,13 +723,18 @@ shutdown the MySQL server and restart it.", name, errno); ...@@ -723,13 +723,18 @@ shutdown the MySQL server and restart it.", name, errno);
int MYSQL_LOG::get_current_log(LOG_INFO* linfo) int MYSQL_LOG::get_current_log(LOG_INFO* linfo)
{ {
pthread_mutex_lock(&LOCK_log); pthread_mutex_lock(&LOCK_log);
int ret = raw_get_current_log(linfo);
pthread_mutex_unlock(&LOCK_log);
return ret;
}
int MYSQL_LOG::raw_get_current_log(LOG_INFO* linfo)
{
strmake(linfo->log_file_name, log_file_name, sizeof(linfo->log_file_name)-1); strmake(linfo->log_file_name, log_file_name, sizeof(linfo->log_file_name)-1);
linfo->pos = my_b_tell(&log_file); linfo->pos = my_b_tell(&log_file);
pthread_mutex_unlock(&LOCK_log);
return 0; return 0;
} }
/* /*
Move all data up in a file in an filename index file Move all data up in a file in an filename index file
......
...@@ -342,6 +342,7 @@ class MYSQL_LOG: public TC_LOG ...@@ -342,6 +342,7 @@ class MYSQL_LOG: public TC_LOG
bool need_mutex); bool need_mutex);
int find_next_log(LOG_INFO* linfo, bool need_mutex); int find_next_log(LOG_INFO* linfo, bool need_mutex);
int get_current_log(LOG_INFO* linfo); int get_current_log(LOG_INFO* linfo);
int raw_get_current_log(LOG_INFO* linfo);
uint next_file_id(); uint next_file_id();
inline bool is_open() { return log_type != LOG_CLOSED; } inline bool is_open() { return log_type != LOG_CLOSED; }
inline char* get_index_fname() { return index_file_name;} inline char* get_index_fname() { return index_file_name;}
......
...@@ -1494,10 +1494,14 @@ bool show_binlogs(THD* thd) ...@@ -1494,10 +1494,14 @@ bool show_binlogs(THD* thd)
if (protocol->send_fields(&field_list, if (protocol->send_fields(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
pthread_mutex_lock(mysql_bin_log.get_log_lock());
mysql_bin_log.lock_index(); mysql_bin_log.lock_index();
index_file=mysql_bin_log.get_index_file(); index_file=mysql_bin_log.get_index_file();
mysql_bin_log.get_current_log(&cur); mysql_bin_log.raw_get_current_log(&cur); // dont take mutex
pthread_mutex_unlock(mysql_bin_log.get_log_lock()); // lockdep, OK
cur_dir_len= dirname_length(cur.log_file_name); cur_dir_len= dirname_length(cur.log_file_name);
reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0); reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0);
......
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