1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-04 04:42:30 +03:00

Suppressed logging self-correcting problems.

It will start logging as an err if it does not self-correct after 10 attempts,
and will escalate to crit after 20 attempts.

Also fixed a silly error where it was checking the file size after it
deleted the file.
This commit is contained in:
Patrick LeBlanc
2020-05-22 13:10:21 -04:00
parent 5d8470b91f
commit 359beb9c96

View File

@ -409,6 +409,7 @@ void Synchronizer::process(list<string>::iterator name)
s.unlock();
bool success = false;
int retryCount = 0;
while (!success)
{
assert(!s.owns_lock());
@ -434,7 +435,10 @@ void Synchronizer::process(list<string>::iterator name)
success = true;
}
catch(exception &e) {
logger->log(LOG_CRIT, "Synchronizer::process(): error sync'ing %s opFlags=%d, got '%s'. Retrying...", key.c_str(),
// these are often self-resolving, so we will suppress logging it for 10 iterations, then escalate
// to error, then to crit
if (++retryCount >= 10)
logger->log((retryCount < 20 ? LOG_ERR : LOG_CRIT), "Synchronizer::process(): error sync'ing %s opFlags=%d, got '%s'. Retrying...", key.c_str(),
pending->opFlags, e.what());
success = false;
sleep(1);
@ -706,7 +710,7 @@ void Synchronizer::synchronizeWithJournal(const string &sourceFile, list<string>
ostringstream oss;
oss << "Synchronizer::synchronizeWithJournal(): detected a mismatch between file size and " <<
"length stored in the object name. object name = " << cloudKey << " length-in-name = " <<
MetadataFile::getLengthFromKey(cloudKey) << " real-length = " << bf::file_size(oldCachePath);
MetadataFile::getLengthFromKey(cloudKey) << " real-length = " << oldSize;
logger->log(LOG_WARNING, oss.str().c_str());
}
}