1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-4566 Fixes after review.

Added:
1. More output logs.
2. Save EM to file after rebuilding.
This commit is contained in:
Denis Khalikov
2021-08-27 13:35:50 +03:00
committed by Denis Khalikov
parent 5c5f103f98
commit a591de666f
2 changed files with 12 additions and 17 deletions

View File

@ -89,8 +89,7 @@ int main(int argc, char** argv)
std::cout << "The launch of mcsRebuildEM tool must be sanctioned by MariaDB support. "
<< std::endl;
std::cout << "Requirement: all DBRoots must be on this node. " << std::endl;
std::cout << "Note: that the launch can break the cluster." << std::endl;
std::cout << "Do you want to continue Y/N? " << std::endl;
std::cout << "Do you want to continue Y/N? ";
std::string confirmation;
cin >> confirmation;
if (confirmation.size() == 0)
@ -124,6 +123,7 @@ int main(int argc, char** argv)
std::cout << "If `BRM_saves_em` "
"exists extent map will be restored from it. "
<< std::endl;
std::cout << "Exiting. " << std::endl;
return 0;
}
@ -131,6 +131,8 @@ int main(int argc, char** argv)
auto rc = emReBuilder.initializeSystemExtents();
if (rc == -1)
{
std::cerr << "Cannot initialize system extents from binary blob." << std::endl;
std::cerr << "Exiting. " << std::endl;
return 1;
}
@ -151,5 +153,8 @@ int main(int argc, char** argv)
emReBuilder.clear();
}
// Save restored extent map.
emReBuilder.getEM().save(BRMSavesEM);
std::cout << "Completed." << std::endl;
return 0;
}

View File

@ -65,9 +65,7 @@ int32_t EMReBuilder::collectExtent(const std::string& fullFileName)
auto rc = WriteEngine::Convertor::fileName2Oid(fullFileName, oid,
partition, segment);
if (rc != 0)
{
return rc;
}
// Open the given file.
std::unique_ptr<IDBDataFile> dbFile(IDBDataFile::open(
@ -97,12 +95,11 @@ int32_t EMReBuilder::collectExtent(const std::string& fullFileName)
// have a header block, so header verification fails in this case,
// currently we skip it, because we cannot deduce needed data to create
// a column extent from the blob file.
if (doVerbose())
// Skip fileID from system catalog.
if (doVerbose() && oid > 3000)
{
std::cerr
<< "Cannot read file header from the file " << fullFileName
<< ", probably this file was created without compression. "
<< std::endl;
std::cerr << "Cannot read file header from the file " << fullFileName
<< ", probably this file was created without compression. " << std::endl;
}
return rc;
}
@ -138,9 +135,8 @@ int32_t EMReBuilder::collectExtent(const std::string& fullFileName)
if (colDataType == execplan::CalpontSystemCatalog::UNDEFINED)
{
if (doVerbose())
{
std::cout << "File header has invalid data. " << std::endl;
}
return -1;
}
@ -158,14 +154,10 @@ int32_t EMReBuilder::collectExtent(const std::string& fullFileName)
rc = searchHWMInSegmentFile(oid, getDBRoot(), partition, segment, colDataType, colWidth,
blockCount, isDict, compressionType, hwm);
if (rc != 0)
{
return rc;
}
if (doVerbose())
{
std::cout << "HWM is: " << hwm << std::endl;
}
const uint32_t extentMaxBlockCount = getEM().getExtentRows() * colWidth / BLOCK_SIZE;
// We found multiple extents per one segment file.
@ -198,9 +190,7 @@ int32_t EMReBuilder::collectExtent(const std::string& fullFileName)
extentMap.push_back(fileId);
if (doVerbose())
{
std::cout << "FileId is collected " << fileId << std::endl;
}
}
return 0;