You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-454 I_S.COLUMNSTORE_FILES multi-node
I_S.COLUMNSTORE_FILES returned bad filenames and NULL file sizes when there are multiple nodes in a ColumnStore cluster It adds an extra message call to the WriteEngine to get the file size for that file. The I_S function will figure out which WriteEngine to communicate with and get the file size details from it.
This commit is contained in:
@ -245,6 +245,38 @@ struct ColumnThread
|
||||
bool fReportRealUse;
|
||||
int fKey;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Get file size from file name in bytestream object
|
||||
//------------------------------------------------------------------------------
|
||||
int WE_GetFileSizes::processFileName(
|
||||
messageqcpp::ByteStream& bs,
|
||||
std::string& errMsg, int key)
|
||||
{
|
||||
uint8_t rc = 0;
|
||||
off_t fileSize;
|
||||
off_t compressedFileSize;
|
||||
errMsg.clear();
|
||||
|
||||
try
|
||||
{
|
||||
std::string fileName;
|
||||
|
||||
bs >> fileName;
|
||||
fileSize = IDBPolicy::size(fileName.c_str());
|
||||
compressedFileSize = IDBPolicy::compressedSize(fileName.c_str());
|
||||
}
|
||||
catch(std::exception& ex)
|
||||
{
|
||||
errMsg = ex.what();
|
||||
rc = 1;
|
||||
}
|
||||
bs.reset();
|
||||
bs << fileSize;
|
||||
bs << compressedFileSize;
|
||||
return rc;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Process a table size based on input from the
|
||||
// bytestream object.
|
||||
|
@ -38,7 +38,7 @@ class WE_GetFileSizes
|
||||
public:
|
||||
|
||||
static int processTable(messageqcpp::ByteStream& bs, std::string& errMsg, int key);
|
||||
|
||||
static int processFileName(messageqcpp::ByteStream& bs, std::string& errMsg, int key);
|
||||
};
|
||||
|
||||
class ActiveThreadCounter
|
||||
|
@ -76,6 +76,7 @@ enum ServerMessages
|
||||
WE_SVR_REDISTRIBUTE,
|
||||
WE_SVR_CLOSE_CONNECTION,
|
||||
WE_SVR_GET_FILESIZES,
|
||||
WE_SVR_GET_FILESIZE,
|
||||
WE_SVR_PURGEFD,
|
||||
WE_END_TRANSACTION,
|
||||
WE_SRV_FIX_ROWS,
|
||||
|
@ -733,6 +733,11 @@ void GetFileSizeThread::operator()()
|
||||
rc = fWeGetFileSizes->processTable(fIbs, errMsg, key);
|
||||
break;
|
||||
}
|
||||
case WE_SVR_GET_FILESIZE:
|
||||
{
|
||||
rc = fWeGetFileSizes->processFileName(fIbs, errMsg, key);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@ -845,6 +850,7 @@ void ReadThreadFactory::CreateReadThread(ThreadPool& Tp, IOSocket& Ios, BRM::DBR
|
||||
}
|
||||
break;
|
||||
case WE_SVR_GET_FILESIZES:
|
||||
case WE_SVR_GET_FILESIZE:
|
||||
{
|
||||
GetFileSizeThread getFileSizeThread(Ios, aBs, dbrm);
|
||||
Tp.invoke(getFileSizeThread);
|
||||
|
Reference in New Issue
Block a user