Commit 69ebe6c3 authored by unknown's avatar unknown

ndb dd - fix bug with many logfile groups and sync_lsn


storage/ndb/src/kernel/blocks/lgman.cpp:
  Fix sync_lsn so that it uses correct logfile group
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Make NdbDictionary wait much longer than 2 minutes
parent c0031f83
...@@ -1035,14 +1035,16 @@ int ...@@ -1035,14 +1035,16 @@ int
Logfile_client::sync_lsn(Signal* signal, Logfile_client::sync_lsn(Signal* signal,
Uint64 lsn, Request* req, Uint32 flags) Uint64 lsn, Request* req, Uint32 flags)
{ {
Lgman::Logfile_group key;
key.m_logfile_group_id= m_logfile_group_id;
Ptr<Lgman::Logfile_group> ptr; Ptr<Lgman::Logfile_group> ptr;
if(m_lgman->m_logfile_group_list.first(ptr)) if(m_lgman->m_logfile_group_hash.find(ptr, key))
{ {
if(ptr.p->m_last_synced_lsn >= lsn) if(ptr.p->m_last_synced_lsn >= lsn)
{ {
return 1; return 1;
} }
bool empty= false; bool empty= false;
Ptr<Lgman::Log_waiter> wait; Ptr<Lgman::Log_waiter> wait;
{ {
......
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
#define DEBUG_PRINT 0 #define DEBUG_PRINT 0
#define INCOMPATIBLE_VERSION -2 #define INCOMPATIBLE_VERSION -2
#define DICT_WAITFOR_TIMEOUT (7*24*60*60*1000)
extern Uint64 g_latest_trans_gci; extern Uint64 g_latest_trans_gci;
bool bool
...@@ -1807,7 +1809,7 @@ NdbDictInterface::getTable(class NdbApiSignal * signal, ...@@ -1807,7 +1809,7 @@ NdbDictInterface::getTable(class NdbApiSignal * signal,
int r = dictSignal(signal, ptr, noOfSections, int r = dictSignal(signal, ptr, noOfSections,
-1, // any node -1, // any node
WAIT_GET_TAB_INFO_REQ, WAIT_GET_TAB_INFO_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, errCodes); DICT_WAITFOR_TIMEOUT, 100, errCodes);
if (r) if (r)
return 0; return 0;
...@@ -2640,7 +2642,7 @@ loop: ...@@ -2640,7 +2642,7 @@ loop:
ret = dictSignal(&tSignal, ptr, 1, ret = dictSignal(&tSignal, ptr, 1,
0, // master 0, // master
WAIT_ALTER_TAB_REQ, WAIT_ALTER_TAB_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
errCodes); errCodes);
if(m_error.code == AlterTableRef::InvalidTableVersion) { if(m_error.code == AlterTableRef::InvalidTableVersion) {
...@@ -2658,7 +2660,7 @@ loop: ...@@ -2658,7 +2660,7 @@ loop:
ret = dictSignal(&tSignal, ptr, 1, ret = dictSignal(&tSignal, ptr, 1,
0, // master node 0, // master node
WAIT_CREATE_INDX_REQ, WAIT_CREATE_INDX_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
errCodes); errCodes);
} }
...@@ -2832,7 +2834,7 @@ NdbDictInterface::dropTable(const NdbTableImpl & impl) ...@@ -2832,7 +2834,7 @@ NdbDictInterface::dropTable(const NdbTableImpl & impl)
int r = dictSignal(&tSignal, 0, 0, int r = dictSignal(&tSignal, 0, 0,
0, // master 0, // master
WAIT_DROP_TAB_REQ, WAIT_DROP_TAB_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
errCodes); errCodes);
if(m_error.code == DropTableRef::InvalidTableVersion) { if(m_error.code == DropTableRef::InvalidTableVersion) {
// Clear caches and try again // Clear caches and try again
...@@ -3086,7 +3088,7 @@ NdbDictInterface::createIndex(Ndb & ndb, ...@@ -3086,7 +3088,7 @@ NdbDictInterface::createIndex(Ndb & ndb,
return dictSignal(&tSignal, ptr, 2, return dictSignal(&tSignal, ptr, 2,
0, // master 0, // master
WAIT_CREATE_INDX_REQ, WAIT_CREATE_INDX_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
errCodes); errCodes);
} }
...@@ -3199,7 +3201,7 @@ NdbDictInterface::dropIndex(const NdbIndexImpl & impl, ...@@ -3199,7 +3201,7 @@ NdbDictInterface::dropIndex(const NdbIndexImpl & impl,
int r = dictSignal(&tSignal, 0, 0, int r = dictSignal(&tSignal, 0, 0,
0, // master 0, // master
WAIT_DROP_INDX_REQ, WAIT_DROP_INDX_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
errCodes); errCodes);
if(m_error.code == DropIndxRef::InvalidIndexVersion) { if(m_error.code == DropIndxRef::InvalidIndexVersion) {
// Clear caches and try again // Clear caches and try again
...@@ -3418,7 +3420,7 @@ NdbDictInterface::createEvent(class Ndb & ndb, ...@@ -3418,7 +3420,7 @@ NdbDictInterface::createEvent(class Ndb & ndb,
int ret = dictSignal(&tSignal,ptr, 1, int ret = dictSignal(&tSignal,ptr, 1,
0, // master 0, // master
WAIT_CREATE_INDX_REQ, WAIT_CREATE_INDX_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
0, -1); 0, -1);
if (ret) { if (ret) {
...@@ -4035,7 +4037,7 @@ NdbDictInterface::listObjects(NdbApiSignal* signal) ...@@ -4035,7 +4037,7 @@ NdbDictInterface::listObjects(NdbApiSignal* signal)
continue; continue;
} }
m_error.code= 0; m_error.code= 0;
int ret_val= poll_guard.wait_n_unlock(WAITFOR_RESPONSE_TIMEOUT, int ret_val= poll_guard.wait_n_unlock(DICT_WAITFOR_TIMEOUT,
aNodeId, WAIT_LIST_TABLES_CONF); aNodeId, WAIT_LIST_TABLES_CONF);
// end protected // end protected
if (ret_val == 0 && m_error.code == 0) if (ret_val == 0 && m_error.code == 0)
...@@ -4095,7 +4097,7 @@ NdbDictInterface::forceGCPWait() ...@@ -4095,7 +4097,7 @@ NdbDictInterface::forceGCPWait()
m_error.code= 0; m_error.code= 0;
m_waiter.m_node = aNodeId; m_waiter.m_node = aNodeId;
m_waiter.m_state = WAIT_LIST_TABLES_CONF; m_waiter.m_state = WAIT_LIST_TABLES_CONF;
m_waiter.wait(WAITFOR_RESPONSE_TIMEOUT); m_waiter.wait(DICT_WAITFOR_TIMEOUT);
m_transporter->unlock_mutex(); m_transporter->unlock_mutex();
return 0; return 0;
} }
...@@ -4421,7 +4423,7 @@ NdbDictInterface::drop_file(const NdbFileImpl & file){ ...@@ -4421,7 +4423,7 @@ NdbDictInterface::drop_file(const NdbFileImpl & file){
DBUG_RETURN(dictSignal(&tSignal, 0, 0, DBUG_RETURN(dictSignal(&tSignal, 0, 0,
0, // master 0, // master
WAIT_CREATE_INDX_REQ, WAIT_CREATE_INDX_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
err)); err));
} }
...@@ -4516,7 +4518,7 @@ NdbDictInterface::create_filegroup(const NdbFilegroupImpl & group){ ...@@ -4516,7 +4518,7 @@ NdbDictInterface::create_filegroup(const NdbFilegroupImpl & group){
DBUG_RETURN(dictSignal(&tSignal, ptr, 1, DBUG_RETURN(dictSignal(&tSignal, ptr, 1,
0, // master 0, // master
WAIT_CREATE_INDX_REQ, WAIT_CREATE_INDX_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
err)); err));
} }
...@@ -4556,7 +4558,7 @@ NdbDictInterface::drop_filegroup(const NdbFilegroupImpl & group){ ...@@ -4556,7 +4558,7 @@ NdbDictInterface::drop_filegroup(const NdbFilegroupImpl & group){
DBUG_RETURN(dictSignal(&tSignal, 0, 0, DBUG_RETURN(dictSignal(&tSignal, 0, 0,
0, // master 0, // master
WAIT_CREATE_INDX_REQ, WAIT_CREATE_INDX_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100, DICT_WAITFOR_TIMEOUT, 100,
err)); err));
} }
...@@ -4605,7 +4607,7 @@ NdbDictInterface::get_filegroup(NdbFilegroupImpl & dst, ...@@ -4605,7 +4607,7 @@ NdbDictInterface::get_filegroup(NdbFilegroupImpl & dst,
int r = dictSignal(&tSignal, ptr, 1, int r = dictSignal(&tSignal, ptr, 1,
-1, // any node -1, // any node
WAIT_GET_TAB_INFO_REQ, WAIT_GET_TAB_INFO_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100); DICT_WAITFOR_TIMEOUT, 100);
if (r) if (r)
{ {
DBUG_PRINT("info", ("get_filegroup failed dictSignal")); DBUG_PRINT("info", ("get_filegroup failed dictSignal"));
...@@ -4694,7 +4696,7 @@ NdbDictInterface::get_filegroup(NdbFilegroupImpl & dst, ...@@ -4694,7 +4696,7 @@ NdbDictInterface::get_filegroup(NdbFilegroupImpl & dst,
int r = dictSignal(&tSignal, NULL, 1, int r = dictSignal(&tSignal, NULL, 1,
-1, // any node -1, // any node
WAIT_GET_TAB_INFO_REQ, WAIT_GET_TAB_INFO_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100); DICT_WAITFOR_TIMEOUT, 100);
if (r) if (r)
{ {
DBUG_PRINT("info", ("get_filegroup failed dictSignal")); DBUG_PRINT("info", ("get_filegroup failed dictSignal"));
...@@ -4747,7 +4749,7 @@ NdbDictInterface::get_file(NdbFileImpl & dst, ...@@ -4747,7 +4749,7 @@ NdbDictInterface::get_file(NdbFileImpl & dst,
int r = dictSignal(&tSignal, ptr, 1, int r = dictSignal(&tSignal, ptr, 1,
node, node,
WAIT_GET_TAB_INFO_REQ, WAIT_GET_TAB_INFO_REQ,
WAITFOR_RESPONSE_TIMEOUT, 100); DICT_WAITFOR_TIMEOUT, 100);
if (r) if (r)
{ {
DBUG_PRINT("info", ("get_file failed dictSignal")); DBUG_PRINT("info", ("get_file failed dictSignal"));
......
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