postgresql/src
Heikki Linnakangas 40dae7ec53 Make the handling of interrupted B-tree page splits more robust.
Splitting a page consists of two separate steps: splitting the child page,
and inserting the downlink for the new right page to the parent. Previously,
we handled the case that you crash in between those steps with a cleanup
routine after the WAL recovery had finished, which finished the incomplete
split. However, that doesn't help if the page split is interrupted but the
database doesn't crash, so that you don't perform WAL recovery. That could
happen for example if you run out of disk space.

Remove the end-of-recovery cleanup step. Instead, when a page is split, the
left page is marked with a new INCOMPLETE_SPLIT flag, and when the downlink
is inserted to the parent, the flag is cleared again. If an insertion sees
a page with the flag set, it knows that the split was interrupted for some
reason, and inserts the missing downlink before proceeding.

I used the same approach to fix GIN and GiST split algorithms earlier. This
was the last WAL cleanup routine, so we could get rid of that whole
machinery now, but I'll leave that for a separate patch.

Reviewed by Peter Geoghegan.
2014-03-18 20:50:44 +02:00
..
backend Make the handling of interrupted B-tree page splits more robust. 2014-03-18 20:50:44 +02:00
bin Add pg_recvlogical, a tool to receive data logical decoding data. 2014-03-18 12:25:14 -04:00
common C comments: remove odd blank lines after #ifdef WIN32 lines 2014-03-13 01:42:24 -04:00
include Make the handling of interrupted B-tree page splits more robust. 2014-03-18 20:50:44 +02:00
interfaces Fix advertised dispsize for libpq's sslmode connection parameter. 2014-03-16 21:43:40 -04:00
makefiles Flush a stray definition of $(DLLTOOL). 2014-02-11 12:59:48 -05:00
pl plperl: Fix memory leak in hek2cstr 2014-03-16 23:22:21 -03:00
port C comments: remove odd blank lines after #ifdef WIN32 lines 2014-03-13 01:42:24 -04:00
template Revert to using --enable-auto-import in Cygwin builds. 2014-02-16 15:14:04 -05:00
test C comments: remove odd blank lines after #ifdef WIN32 lines 2014-03-13 01:34:42 -04:00
timezone Update time zone data files to tzdata release 2014a. 2014-03-15 13:36:07 -04:00
tools Allow logical decoding via the walsender interface. 2014-03-10 13:50:28 -04:00
tutorial Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Introduce logical decoding. 2014-03-03 16:32:18 -05:00
Makefile.shlib Tweak position of $(DLL_DEFFILE) in shared-library link commands. 2014-02-12 11:22:23 -05:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
nls-global.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00