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 xxxxx correct sized files #19355

Draft
wants to merge 2 commits into
base: candidate-9.6.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13807,6 +13807,39 @@ void configurePreferredPlanes()
}
}

static bool doesPhysicalMatchMeta(IPropertyTree &partProps, IFile &iFile, offset_t &expectedSize, offset_t &actualSize)
{
// NB: temporary workaround for 'narrow' files publishing extra empty parts with the wrong @compressedSize(0)
// causing a new check introduced in HPCC-33064 to be hit (fixed in HPCC-33113, but will continue to affect exiting files)
unsigned __int64 size = partProps.getPropInt64("@size", (unsigned __int64)-1);
unsigned __int64 compressedSize = partProps.getPropInt64("@compressedSize", (unsigned __int64)-1);
if ((0 == size) && (0 == compressedSize))
return true;

if (expectedSize != unknownFileSize)
{
actualSize = iFile.size();
if (actualSize != expectedSize)
return false;
}
return true;
}

bool doesPhysicalMatchMeta(IPartDescriptor &partDesc, IFile &iFile, offset_t &expectedSize, offset_t &actualSize)
{
IPropertyTree &partProps = partDesc.queryProperties();
expectedSize = partDesc.getDiskSize(false, false);
return doesPhysicalMatchMeta(partProps, iFile, expectedSize, actualSize);
}

bool doesPhysicalMatchMeta(IDistributedFilePart &part, IFile &iFile, offset_t &expectedSize, offset_t &actualSize)
{
IPropertyTree &partProps = part.queryAttributes();
expectedSize = part.getDiskSize(false, false);
return doesPhysicalMatchMeta(partProps, iFile, expectedSize, actualSize);
}


#ifdef _USE_CPPUNIT
/*
* This method removes files only logically. removeEntry() used to do that, but the only
Expand Down
4 changes: 4 additions & 0 deletions dali/base/dadfs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,4 +925,8 @@ inline cost_type getLegacyWriteCost(const IPropertyTree & fileAttr, Source sourc
else
return 0;
}

extern da_decl bool doesPhysicalMatchMeta(IPartDescriptor &partDesc, IFile &iFile, offset_t &expectedSize, offset_t &actualSize);
extern da_decl bool doesPhysicalMatchMeta(IDistributedFilePart &partDesc, IFile &iFile, offset_t &expectedSize, offset_t &actualSize);

#endif
10 changes: 3 additions & 7 deletions ecl/hthor/hthor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8737,13 +8737,9 @@ bool CHThorDiskReadBaseActivity::openNext()

if (curPart)
{
offset_t expectedSize = curPart->getDiskSize(false, false);
if (expectedSize != unknownFileSize)
{
offset_t actualSize = inputfile->size();
if(actualSize != expectedSize)
throw MakeStringException(0, "File size mismatch: file %s was supposed to be %" I64F "d bytes but appears to be %" I64F "d bytes", inputfile->queryFilename(), expectedSize, actualSize);
}
offset_t expectedSize, actualSize;
if (!doesPhysicalMatchMeta(*curPart, *inputfile, expectedSize, actualSize))
throw makeStringExceptionV(0, "File size mismatch: file %s was supposed to be %" I64F "d bytes but appears to be %" I64F "d bytes", inputfile->queryFilename(), expectedSize, actualSize);
}

if (compressed)
Expand Down
10 changes: 3 additions & 7 deletions thorlcr/activities/diskread/thdiskreadslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,9 @@ void CDiskRecordPartHandler::open()

rwFlags |= DEFAULT_RWFLAGS;

offset_t expectedSize = partDesc->getDiskSize(false, false);
if (expectedSize != unknownFileSize)
{
offset_t actualSize = iFile->size();
if(actualSize != expectedSize)
throw MakeStringException(0, "File size mismatch: file %s was supposed to be %" I64F "d bytes but appears to be %" I64F "d bytes", iFile->queryFilename(), expectedSize, actualSize);
}
offset_t expectedSize, actualSize;
if (!doesPhysicalMatchMeta(*partDesc, *iFile, expectedSize, actualSize))
throw MakeActivityException(&activity, 0, "File size mismatch: file %s was supposed to be %" I64F "d bytes but appears to be %" I64F "d bytes", iFile->queryFilename(), expectedSize, actualSize);

if (compressed)
{
Expand Down
4 changes: 2 additions & 2 deletions thorlcr/mfilemanager/thmfilemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,12 @@ class CFileManager : public CSimpleInterface, implements IThorFileManager
break;
};
#endif
unsigned offset = 0;
// unsigned offset = 0;
unsigned total;
if (restrictedWidth)
total = restrictedWidth;
else
total = fixTotal(job, groups, offset);
total = job.querySlaves(); //fixTotal(job, groups, offset);
if (nonLocalIndex)
++total;
StringBuffer dir;
Expand Down
Loading