1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-1558. This likely covers it. First cut.

This commit is contained in:
Patrick LeBlanc
2018-11-15 15:33:50 -06:00
parent 65779c7d83
commit 86c64d6dc0
3 changed files with 16 additions and 9 deletions

View File

@ -2581,7 +2581,8 @@ pid_t ProcessMonitor::startProcess(string processModuleType, string processName,
char line[200] = {0}; char line[200] = {0};
oldFile->pread(line, 0, fileSize - 1); // skip the \n oldFile->pread(line, 0, fileSize - 1); // skip the \n
line[fileSize] = '\0'; // not necessary, but be sure. line[fileSize] = '\0'; // not necessary, but be sure.
string dbrmFile = line; // MCOL-1558 - the _current file is now relative to DBRMRoot
string dbrmFile = DBRMroot + line;
// if ( !gOAMParentModuleFlag ) { // if ( !gOAMParentModuleFlag ) {

View File

@ -100,7 +100,9 @@ int main (int argc, char** argv)
#ifndef _MSC_VER #ifndef _MSC_VER
prefix += '\n'; prefix += '\n';
#endif #endif
currentFile->write(prefix.c_str(), prefix.length()); // for MCOL-1558. Make the _current file relative to DBRMRoot
string relative = prefix.substr(prefix.find_last_of('/'));
currentFile->write(relative.c_str(), relative.length());
} }
catch (exception& e) catch (exception& e)
{ {

View File

@ -2038,9 +2038,11 @@ void SlaveComm::do_confirm()
if (currentSaveFile) if (currentSaveFile)
{ {
err = currentSaveFile->write(tmp.c_str(), tmp.length()); // MCOL-1558. Make the _current file relative to DBRMRoot.
string relative = tmp.substr(tmp.find_last_of('/') + 1);
err = currentSaveFile->write(relative.c_str(), relative.length());
if (err < (int) tmp.length()) if (err < (int) relative.length())
{ {
ostringstream os; ostringstream os;
os << "WorkerComm: currentfile write() returned " << err os << "WorkerComm: currentfile write() returned " << err
@ -2070,9 +2072,11 @@ void SlaveComm::do_confirm()
else else
{ {
lseek(currentSaveFD, 0, SEEK_SET); lseek(currentSaveFD, 0, SEEK_SET);
err = write(currentSaveFD, tmp.c_str(), tmp.length()); // MCOL-1558. Make the _current file relative to DBRMRoot.
string relative = tmp.substr(tmp.find_last_of('/') + 1);
err = write(currentSaveFD, relative.c_str(), relative.length());
if (err < (int) tmp.length()) if (err < (int) relative.length())
{ {
ostringstream os; ostringstream os;
os << "WorkerComm: currentfile write() returned " << err os << "WorkerComm: currentfile write() returned " << err
@ -2089,7 +2093,7 @@ void SlaveComm::do_confirm()
_chsize_s(currentSaveFD, tmp.length()); _chsize_s(currentSaveFD, tmp.length());
_commit(currentSaveFD); _commit(currentSaveFD);
#else #else
err = ftruncate(currentSaveFD, tmp.length()); err = ftruncate(currentSaveFD, relative.length());
fsync(currentSaveFD); fsync(currentSaveFD);
#endif #endif
saveFileToggle = !saveFileToggle; saveFileToggle = !saveFileToggle;