mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Track block level checksum failures in pg_stat_database
This adds a column that counts how many checksum failures have occurred on files belonging to a specific database. Both checksum failures during normal backend processing and those created when a base backup detects a checksum failure are counted. Author: Magnus Hagander Reviewed by: Julien Rouhaud
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "access/htup_details.h"
|
||||
#include "access/itup.h"
|
||||
#include "access/xlog.h"
|
||||
#include "pgstat.h"
|
||||
#include "storage/checksum.h"
|
||||
#include "utils/memdebug.h"
|
||||
#include "utils/memutils.h"
|
||||
@@ -151,6 +152,8 @@ PageIsVerified(Page page, BlockNumber blkno)
|
||||
errmsg("page verification failed, calculated checksum %u but expected %u",
|
||||
checksum, p->pd_checksum)));
|
||||
|
||||
pgstat_report_checksum_failure();
|
||||
|
||||
if (header_sane && ignore_checksum_failure)
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user