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-33132 Add retry if physical mismatches meta #19363

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
35 changes: 31 additions & 4 deletions dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13809,21 +13809,48 @@ void configurePreferredPlanes()

static bool doesPhysicalMatchMeta(IPropertyTree &partProps, IFile &iFile, offset_t expectedSize, offset_t &actualSize)
{
constexpr unsigned delaySecs = 5;
// 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", unknownFileSize);
unsigned __int64 compressedSize = partProps.getPropInt64("@compressedSize", unknownFileSize);
if ((0 == size) && (0 == compressedSize))
{
actualSize = unknownFileSize;
// either this is a file from 9.10 where empty compressed files can be zero length (no header)
// or it's a pre 9.10 (and pre HPCC-33133 fix) dummy part created with incorrect a @compressedSize of 0
// (also in future empty physical files may legitimately not exist)
// If file exists check that the size is either 0, or the compressed header size (the size of an empty compressed file pre 9.10)
actualSize = iFile.size();
if (unknownFileSize != actualSize) // file exists. NB: ok not to exist for future compatibility where 0-length files not written
{
if (0 != actualSize) // could be zero if file from >= 9.10
{
constexpr size32_t nonEmptyCompressedFileSize = 56; // min size of a non-empty compressed file (with header) - 56 bytes
if (nonEmptyCompressedFileSize != actualSize)
{
// in >= 9.8 - this could 1st check getWriteSyncMarginMs() and only check if not set.
WARNLOG("Empty compressed file %s's size (%" I64F "u) is not expected size of 0 or %u - retry after %u second delay", iFile.queryFilename(), actualSize, nonEmptyCompressedFileSize, delaySecs);
MilliSleep(delaySecs * 1000);
actualSize = iFile.size();
if ((0 != actualSize) && (nonEmptyCompressedFileSize != actualSize))
return false; // including if unknownFileSize - no longer exists!
}
}
}
return true;
}

if (expectedSize != unknownFileSize)
else if (expectedSize != unknownFileSize)
{
actualSize = iFile.size();
if (actualSize != expectedSize)
return false;
{
// in >= 9.8 - this could 1st check getWriteSyncMarginMs() and only check if not set.
WARNLOG("File %s's size (%" I64F "u) does not match meta size (%" I64F "u) - retry after %u second delay", iFile.queryFilename(), actualSize, expectedSize, delaySecs);
MilliSleep(delaySecs * 1000);
actualSize = iFile.size();
if (actualSize != expectedSize)
return false;
}
}
else
actualSize = unknownFileSize;
Expand Down
Loading