ndb -

1) relax version check for restore block since no changes has happend since 5.1.6
   and improve error message on check failure
   
2) improve lcp/backup max write size...
parent f4226023
...@@ -171,7 +171,7 @@ Backup::execREAD_CONFIG_REQ(Signal* signal) ...@@ -171,7 +171,7 @@ Backup::execREAD_CONFIG_REQ(Signal* signal)
c_defaults.m_logBufferSize = szLogBuf; c_defaults.m_logBufferSize = szLogBuf;
c_defaults.m_dataBufferSize = szDataBuf; c_defaults.m_dataBufferSize = szDataBuf;
c_defaults.m_minWriteSize = szWrite; c_defaults.m_minWriteSize = szWrite;
c_defaults.m_maxWriteSize = szWrite; c_defaults.m_maxWriteSize = 256*1024;
c_defaults.m_lcp_buffer_size = szDataBuf; c_defaults.m_lcp_buffer_size = szDataBuf;
......
...@@ -547,9 +547,10 @@ Restore::restore_next(Signal* signal, FilePtr file_ptr) ...@@ -547,9 +547,10 @@ Restore::restore_next(Signal* signal, FilePtr file_ptr)
parse_gcp_entry(signal, file_ptr, data, len); parse_gcp_entry(signal, file_ptr, data, len);
break; break;
case 0x4e444242: // 'NDBB' case 0x4e444242: // 'NDBB'
if(ntohl(* (data+2)) != NDB_VERSION) if (check_file_version(signal, ntohl(* (data+2))) == 0)
parse_error(signal, file_ptr, __LINE__, ntohl(* (data+2))); {
break; break;
}
default: default:
parse_error(signal, file_ptr, __LINE__, ntohl(* data)); parse_error(signal, file_ptr, __LINE__, ntohl(* data));
} }
...@@ -719,7 +720,7 @@ Restore::parse_file_header(Signal* signal, ...@@ -719,7 +720,7 @@ Restore::parse_file_header(Signal* signal,
return; return;
} }
if(ntohl(fh->NdbVersion) != NDB_VERSION) if (check_file_version(signal, ntohl(fh->NdbVersion)))
{ {
parse_error(signal, file_ptr, __LINE__, ntohl(fh->NdbVersion)); parse_error(signal, file_ptr, __LINE__, ntohl(fh->NdbVersion));
return; return;
...@@ -1227,3 +1228,23 @@ operator << (NdbOut& ndbout, const Restore::Column& col) ...@@ -1227,3 +1228,23 @@ operator << (NdbOut& ndbout, const Restore::Column& col)
return ndbout; return ndbout;
} }
int
Restore::check_file_version(Signal* signal, Uint32 file_version)
{
if (file_version < MAKE_VERSION(5,1,6))
{
char buf[255];
char verbuf[255];
getVersionString(file_version, 0, verbuf, sizeof(verbuf));
BaseString::snprintf(buf, sizeof(buf),
"Unsupported version of LCP files found on disk, "
" found: %s", verbuf);
progError(__LINE__,
NDBD_EXIT_SR_RESTARTCONFLICT,
buf);
return -1;
}
return 0;
}
...@@ -140,6 +140,7 @@ private: ...@@ -140,6 +140,7 @@ private:
Uint32 calulate_hash(Uint32 tableId, const Uint32 *src); Uint32 calulate_hash(Uint32 tableId, const Uint32 *src);
void parse_error(Signal*, FilePtr, Uint32 line, Uint32 extra); void parse_error(Signal*, FilePtr, Uint32 line, Uint32 extra);
int check_file_version(Signal*, Uint32 file_version);
public: public:
private: private:
......
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