Commit de513b18 authored by unknown's avatar unknown

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...


storage/ndb/src/kernel/blocks/backup/BackupInit.cpp:
  Increase max write size to 256k (currently not configurable...)
storage/ndb/src/kernel/blocks/restore.cpp:
  Relax version check for restore block since no changes has happend since 5.1.6
storage/ndb/src/kernel/blocks/restore.hpp:
  Relax version check for restore block since no changes has happend since 5.1.6
parent 3e3842fa
......@@ -171,7 +171,7 @@ Backup::execREAD_CONFIG_REQ(Signal* signal)
c_defaults.m_logBufferSize = szLogBuf;
c_defaults.m_dataBufferSize = szDataBuf;
c_defaults.m_minWriteSize = szWrite;
c_defaults.m_maxWriteSize = szWrite;
c_defaults.m_maxWriteSize = 256*1024;
c_defaults.m_lcp_buffer_size = szDataBuf;
......
......@@ -547,9 +547,10 @@ Restore::restore_next(Signal* signal, FilePtr file_ptr)
parse_gcp_entry(signal, file_ptr, data, len);
break;
case 0x4e444242: // 'NDBB'
if(ntohl(* (data+2)) != NDB_VERSION)
parse_error(signal, file_ptr, __LINE__, ntohl(* (data+2)));
break;
if (check_file_version(signal, ntohl(* (data+2))) == 0)
{
break;
}
default:
parse_error(signal, file_ptr, __LINE__, ntohl(* data));
}
......@@ -719,7 +720,7 @@ Restore::parse_file_header(Signal* signal,
return;
}
if(ntohl(fh->NdbVersion) != NDB_VERSION)
if (check_file_version(signal, ntohl(fh->NdbVersion)))
{
parse_error(signal, file_ptr, __LINE__, ntohl(fh->NdbVersion));
return;
......@@ -1227,3 +1228,23 @@ operator << (NdbOut& ndbout, const Restore::Column& col)
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:
Uint32 calulate_hash(Uint32 tableId, const Uint32 *src);
void parse_error(Signal*, FilePtr, Uint32 line, Uint32 extra);
int check_file_version(Signal*, Uint32 file_version);
public:
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