Commit 151af6b4 authored by unknown's avatar unknown

ndb -

    Add better error message if getting error in RESTORE
parent a05e44b8
......@@ -146,6 +146,8 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification;
#define NDBD_EXIT_AFS_NO_SUCH_FILE 2815
#define NDBD_EXIT_AFS_READ_UNDERFLOW 2816
#define NDBD_EXIT_INVALID_LCP_FILE 2352
const char *
ndbd_exit_message(int faultId, ndbd_exit_classification *cl);
const char *
......
......@@ -242,7 +242,7 @@ Restore::execRESTORE_LCP_REQ(Signal* signal){
break;
}
open_file(signal, file_ptr, req->lcpNo);
open_file(signal, file_ptr);
return;
} while(0);
......@@ -265,6 +265,7 @@ Restore::init_file(const RestoreLcpReq* req, FilePtr file_ptr)
file_ptr.p->m_file_type = BackupFormat::LCP_FILE;
file_ptr.p->m_status = File::FIRST_READ;
file_ptr.p->m_lcp_no = req->lcpNo;
file_ptr.p->m_table_id = req->tableId;
file_ptr.p->m_fragment_id = req->fragmentId;
file_ptr.p->m_table_version = RNIL;
......@@ -352,7 +353,7 @@ Restore::release_file(FilePtr file_ptr)
}
void
Restore::open_file(Signal* signal, FilePtr file_ptr, Uint32 lcpNo)
Restore::open_file(Signal* signal, FilePtr file_ptr)
{
FsOpenReq * req = (FsOpenReq *)signal->getDataPtrSend();
req->userReference = reference();
......@@ -361,7 +362,7 @@ Restore::open_file(Signal* signal, FilePtr file_ptr, Uint32 lcpNo)
FsOpenReq::setVersion(req->fileNumber, 5);
FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA);
FsOpenReq::v5_setLcpNo(req->fileNumber, lcpNo);
FsOpenReq::v5_setLcpNo(req->fileNumber, file_ptr.p->m_lcp_no);
FsOpenReq::v5_setTableId(req->fileNumber, file_ptr.p->m_table_id);
FsOpenReq::v5_setFragmentId(req->fileNumber, file_ptr.p->m_fragment_id);
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
......@@ -1216,6 +1217,17 @@ void
Restore::parse_error(Signal* signal,
FilePtr file_ptr, Uint32 line, Uint32 extra)
{
char buf[255], name[100];
BaseString::snprintf(name, sizeof(name), "%u/T%dF%d",
file_ptr.p->m_lcp_no,
file_ptr.p->m_table_id,
file_ptr.p->m_fragment_id);
BaseString::snprintf(buf, sizeof(buf),
"Parse error in file: %s, extra: %d",
name, extra);
progError(line, NDBD_EXIT_INVALID_LCP_FILE, buf);
ndbrequire(false);
}
......
......@@ -116,6 +116,7 @@ private:
Uint32 nextList;
Uint32 prevList;
Uint32 nextPool;
Uint32 m_lcp_no;
bool is_lcp() const { return m_file_type == BackupFormat::LCP_FILE;}
};
......@@ -124,7 +125,7 @@ private:
Uint32 init_file(const struct RestoreLcpReq*, FilePtr);
void release_file(FilePtr);
void open_file(Signal*, FilePtr, Uint32 lcpNo);
void open_file(Signal*, FilePtr);
void read_file(Signal*, FilePtr);
void restore_next(Signal*, FilePtr);
void parse_file_header(Signal*, FilePtr, const Uint32*, Uint32 len);
......
......@@ -158,7 +158,9 @@ static const ErrStruct errArray[] =
"System reports no more file system resources"},
{NDBD_EXIT_AFS_NO_SUCH_FILE , XFI, "File not found"},
{NDBD_EXIT_AFS_READ_UNDERFLOW , XFI, "Read underflow"},
{NDBD_EXIT_INVALID_LCP_FILE, XFI, "Invalid LCP" },
/* Sentinel */
{0, XUE,
"No message slogan found (please report a bug if you get this error code)"}
......
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