1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-5021 non-AUX column files are opened in read-only mode during

the DELETE operation. ColumnOp::readBlock() calls can cause writes
to database files when the active chunk list in ChunkManager is full.
Since non-AUX columns are read-only for the DELETE operation, we prevent
writes of compressed chunks and header for these columns by passing
an isReadOnly flag to CompFileData which indicates whether the column
is read-only or read-write.
This commit is contained in:
Gagan Goel
2022-04-22 17:06:08 -04:00
parent 35a3a93964
commit 60eb0f86ec
9 changed files with 55 additions and 43 deletions

View File

@ -1407,15 +1407,22 @@ bool ColumnOp::isValid(Column& column) const
***********************************************************/
// @bug 5572 - HDFS usage: add *.tmp file backup flag
int ColumnOp::openColumnFile(Column& column, std::string& segFile, bool useTmpSuffix,
int ioBuffSize) const
int ioBuffSize, bool isReadOnly) const
{
if (!isValid(column))
return ERR_INVALID_PARAM;
std::string mode;
if (isReadOnly)
mode = "r";
else
mode = "r+b";
// open column data file
column.dataFile.pFile =
openFile(column, column.dataFile.fDbRoot, column.dataFile.fPartition, column.dataFile.fSegment,
column.dataFile.fSegFileName, useTmpSuffix, "r+b", ioBuffSize);
column.dataFile.fSegFileName, useTmpSuffix, mode.c_str(), ioBuffSize, isReadOnly);
segFile = column.dataFile.fSegFileName;
if (column.dataFile.pFile == NULL)
@ -1824,7 +1831,7 @@ int ColumnOp::writeRowsReadOnly(Column& curCol, uint64_t totalRow, const RIDList
{
curDataFbo = dataFbo;
//@Bug 4849. need to check error code to prevent disk error
rc = readBlock(curCol.dataFile.pFile, dataBuf, curDataFbo, true);
rc = readBlock(curCol.dataFile.pFile, dataBuf, curDataFbo);
if (rc != NO_ERROR)
return rc;