turnstep / pg_healer Goto Github PK
View Code? Open in Web Editor NEWRepair Postgres corruption automatically
License: Other
Repair Postgres corruption automatically
License: Other
I'm a little nervous about the idea of replacing a page based only on a 16-bit checksum. Have you considered using PageHeader->pd_lsn as a crosscheck?
$ make install
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -g -O2 -fdebug-prefix-map=/build/postgresql-10-QwtiCa/postgresql-10-10.12=. -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/10/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c -o pg_healer.o pg_healer.c
pg_healer.c: In function ‘pg_healer_checksum’:
pg_healer.c:72:38: warning: passing argument 1 of ‘pg_checksum_block’ from incompatible pointer type [-Wincompatible-pointer-types]
actual_checksum = pg_checksum_block(page, BLCKSZ);
^~~~
In file included from pg_healer.c:24:0:
/usr/include/postgresql/10/server/storage/checksum_impl.h:146:1: note: expected ‘const PGChecksummablePage * {aka const union <anonymous> *}’ but argument is of type ‘char *’
pg_checksum_block(const PGChecksummablePage *page)
^~~~~~~~~~~~~~~~~
pg_healer.c:72:20: error: too many arguments to function ‘pg_checksum_block’
actual_checksum = pg_checksum_block(page, BLCKSZ);
^~~~~~~~~~~~~~~~~
In file included from pg_healer.c:24:0:
/usr/include/postgresql/10/server/storage/checksum_impl.h:146:1: note: declared here
pg_checksum_block(const PGChecksummablePage *page)
^~~~~~~~~~~~~~~~~
pg_healer.c: In function ‘pg_healer_repair_external’:
pg_healer.c:471:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(ext_pageBuffer, BLCKSZ, 1, ext_fh);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pg_healer.c: In function ‘pg_healer_repair_path’:
pg_healer.c:626:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(pageBuffer, BLCKSZ, 1, fh);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<builtin>: recipe for target 'pg_healer.o' failed
make: *** [pg_healer.o] Error 1
I see the only active issue here is one in which a question was asked about a year ago with no response. Is it still safe to use this promising tool?
@turnstep
Please add current project status to README.md
so everyone can see it.
Nobody is working on it - was mostly a proof of concept. However, nothing has radically changed since it was written, so it should work on PG 11/12 with some minimal tweaking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.