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-32730 Fix fileSyncMaxRetrySecs and add tracing #19160

Merged
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
10 changes: 8 additions & 2 deletions system/jlib/jfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2066,9 +2066,14 @@ static void retrySync(int fd, int retrySecs, bool dataOnly)
unsigned retryAttempts = 0;
while (true)
{
CCycleTimer timer;
int ret = dataOnly ? fdatasync(fd) : fsync(fd);
if (ret == 0)
{
if (timer.elapsedMs() >= 10000)
IWARNLOG("retrySync slow fsync success: took %u ms", timer.elapsedMs());
break;
}
if (fileSyncRetryDisabled == retrySecs) // error, but unchecked! Temporary, to allow to be disabled JIC causes unexpected side-effects
break;
if (EIO != errno)
Expand All @@ -2081,7 +2086,7 @@ static void retrySync(int fd, int retrySecs, bool dataOnly)
throw e.getClear();
}
// In the event, not sure I care about burst of logging on retries (there won't be that many and this is fatal last throw of dice)
IWARNLOG("retrySync: failed with EIO, retry: %u", ++retryAttempts);
IWARNLOG("retrySync: failed after %u ms with EIO, retry: %u", timer.elapsedMs(), ++retryAttempts);
if (delayMs >= 60000) // cap max delay to 1 minute
MilliSleep(60000);
else
Expand Down Expand Up @@ -7975,8 +7980,9 @@ MODULE_INIT(INIT_PRIORITY_STANDARD)
value = plane.getPropInt64(("@" + std::string(planeAttributeTypeStrings[BlockedSequentialIO])).c_str(), unsetPlaneAttrValue);
values[BlockedSequentialIO] = (unsetPlaneAttrValue != value) ? value * 1024 : value;
value = plane.getPropInt64(("@" + std::string(planeAttributeTypeStrings[BlockedRandomIO])).c_str(), unsetPlaneAttrValue);
// plane expert settings
values[BlockedRandomIO] = (unsetPlaneAttrValue != value) ? value * 1024 : value;
values[FileSyncMaxRetrySecs] = plane.getPropInt64(("@" + std::string(planeAttributeTypeStrings[FileSyncMaxRetrySecs])).c_str(), unsetPlaneAttrValue);
values[FileSyncMaxRetrySecs] = plane.getPropInt64(("expert/@" + std::string(planeAttributeTypeStrings[FileSyncMaxRetrySecs])).c_str(), unsetPlaneAttrValue);
}

// reset defaults
Expand Down
Loading