Skip to content

Commit

Permalink
HPCC-33045 Add an option to check size consistency within the write s…
Browse files Browse the repository at this point in the history
…ync margin

Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed Nov 28, 2024
1 parent d5e41b7 commit 11d0fc8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3813,13 +3813,31 @@ protected: friend class CDistributedFilePart;
if (unlikely(elapsedMs < marginMs))
{
LOG(MCuserProgress, "Delaying access to %s on %s for %ums to ensure write sync", queryLogicalName(), name, (unsigned)(marginMs - elapsedMs));
checkSizeConsistency("Before write sync delay");
MilliSleep(marginMs - elapsedMs);
checkSizeConsistency("After write sync delay");
now = 0; // re-evaluate now - unlikely to actually happen
}
}
}
}

void checkSizeConsistency(const char * when)
{
auto checkPartSize = [this,when](unsigned idx) -> void
{
IDistributedFilePart &part = queryPart(idx);
offset_t size = part.getDiskSize(false, false);
if (size != (offset_t)-1)
{
offset_t physicalSize = part.getDiskSize(true, true);
if (size != physicalSize)
OWARNLOG("%s: Part %d of file %s is inconsistent: logical size = %" I64F "d, physical size = %" I64F "d", when, idx, queryLogicalName(), size, physicalSize);
}
};
asyncFor(numParts(), checkPartSize);
}

bool hasDirPerPart() const
{
return FileDescriptorFlags::none != (fileFlags & FileDescriptorFlags::dirperpart);
Expand Down

0 comments on commit 11d0fc8

Please sign in to comment.