Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-33113 Ensure empty compressed part size is correct #19353

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions thorlcr/activities/thdiskbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ void CWriteMasterBase::publish()
compMethod = COMPRESS_METHOD_LZ4HC;
bool blockCompressed;
bool compressed = fileDesc->isCompressed(&blockCompressed);

// NB: it would be far preferable to avoid this and have the file reference a group with the correct number of parts
// Possibly could use subgroup syntax: 'data[1..n]'
for (unsigned clusterIdx=0; clusterIdx<fileDesc->numClusters(); clusterIdx++)
{
StringBuffer clusterName;
Expand All @@ -305,6 +308,7 @@ void CWriteMasterBase::publish()
p += queryJob().querySlaves();
IPartDescriptor *partDesc = fileDesc->queryPart(p);
CDateTime createTime, modifiedTime;
offset_t compSize = 0;
for (unsigned c=0; c<partDesc->numCopies(); c++)
{
RemoteFilename rfn;
Expand All @@ -316,15 +320,18 @@ void CWriteMasterBase::publish()
ensureDirectoryForFile(path.str());
OwnedIFile iFile = createIFile(path.str());
Owned<IFileIO> iFileIO;
if (compressed)
if (compressed) // NB: this would not be necessary if all builds have the changes in HPCC-32651
iFileIO.setown(createCompressedFileWriter(iFile, recordSize, false, true, NULL, compMethod));
else
iFileIO.setown(iFile->open(IFOcreate));
dbgassertex(iFileIO.get());
iFileIO.clear();
// ensure copies have matching datestamps, as they would do normally (backupnode expects it)
if (0 == c)
{
iFile->getTime(&createTime, &modifiedTime, NULL);
compSize = iFile->size();
}
else
iFile->setTime(&createTime, &modifiedTime, NULL);
}
Expand All @@ -345,7 +352,7 @@ void CWriteMasterBase::publish()
props.setPropInt64("@recordCount", 0);
props.setPropInt64("@size", 0);
if (compressed)
props.setPropInt64("@compressedSize", 0);
props.setPropInt64("@compressedSize", compSize);
p++;
}
}
Expand Down
Loading