diff options
author | unknown <tomas@whalegate.ndb.mysql.com> | 2007-05-15 12:02:58 +0200 |
---|---|---|
committer | unknown <tomas@whalegate.ndb.mysql.com> | 2007-05-15 12:02:58 +0200 |
commit | 10e3a96e470b69aaa39ba889152bafca52bdd53a (patch) | |
tree | b47e2f841f4b80a1e62440d1105a3d7e993044e9 /ndb | |
parent | bc5ef9ffa190133061c35def819ba329f727749e (diff) | |
download | mariadb-git-10e3a96e470b69aaa39ba889152bafca52bdd53a.tar.gz |
improve error message on corrup schema file
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index fd7aabc8b67..a8db352e705 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -79,6 +79,9 @@ #include <NdbSleep.h> #include <signaldata/ApiBroadcast.hpp> +#include <EventLogger.hpp> +extern EventLogger g_eventLogger; + #define ZNOT_FOUND 626 #define ZALREADYEXIST 630 @@ -1070,26 +1073,34 @@ void Dbdict::readSchemaConf(Signal* signal, for (Uint32 n = 0; n < xsf->noOfPages; n++) { SchemaFile * sf = &xsf->schemaPage[n]; bool ok = false; + const char *reason; if (memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) != 0) - { jam(); } + { jam(); reason = "magic code"; } else if (sf->FileSize == 0) - { jam(); } + { jam(); reason = "file size == 0"; } else if (sf->FileSize % NDB_SF_PAGE_SIZE != 0) - { jam(); } + { jam(); reason = "invalid size multiple"; } else if (sf->FileSize != sf0->FileSize) - { jam(); } + { jam(); reason = "invalid size"; } else if (sf->PageNumber != n) - { jam(); } + { jam(); reason = "invalid page number"; } else if (computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) != 0) - { jam(); } - else if (crashInd) - { jam(); } + { jam(); reason = "invalid checksum"; } else ok = true; - ndbrequireErr(ok, NDBD_EXIT_SR_SCHEMAFILE); - if (! ok) { + + if (!ok) + { + char reason_msg[128]; + snprintf(reason_msg, sizeof(reason_msg), + "schema file corrupt, page %u (%s, " + "sz=%u sz0=%u pn=%u)", + n, reason, sf->FileSize, sf0->FileSize, sf->PageNumber); + if (crashInd) + progError(__LINE__, NDBD_EXIT_SR_SCHEMAFILE, reason_msg); jam(); ndbrequire(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1); + infoEvent("primary %s, trying backup", reason_msg); readSchemaRef(signal, fsPtr); return; } |