Avoid tracing in PageChecksumCodec::checksum if silent flag is set

This commit is contained in:
Trevor Clinkenbeard 2019-05-17 10:49:53 -07:00
parent d7bcbe1210
commit 12ff747e6a
1 changed files with 12 additions and 11 deletions

View File

@ -117,17 +117,18 @@ struct PageChecksumCodec {
hashlittle2(pData, dataLen, &hashLittle2Sum.part1, &hashLittle2Sum.part2);
if (hashLittle2Sum == *pSumInPage) return true;
TraceEvent tr(SevError, "SQLitePageChecksumFailure");
tr.error(checksum_failed())
.detail("CodecPageSize", pageSize)
.detail("CodecReserveSize", reserveSize)
.detail("Filename", filename)
.detail("PageNumber", pageNumber)
.detail("PageSize", pageLen)
.detail("ChecksumInPage", pSumInPage->toString())
.detail("ChecksumCalculatedHL2", hashLittle2Sum.toString());
if (pSumInPage->part1 == 0)
tr.detail("ChecksumCalculatedCRC", sum.toString());
if (!silent) {
TraceEvent trEvent(SevError, "SQLitePageChecksumFailure");
trEvent.error(checksum_failed())
.detail("CodecPageSize", pageSize)
.detail("CodecReserveSize", reserveSize)
.detail("Filename", filename)
.detail("PageNumber", pageNumber)
.detail("PageSize", pageLen)
.detail("ChecksumInPage", pSumInPage->toString())
.detail("ChecksumCalculatedHL2", hashLittle2Sum.toString());
if (pSumInPage->part1 == 0) trEvent.detail("ChecksumCalculatedCRC", sum.toString());
}
return false;
}