diff options
| author | Robert Haas <rhaas@postgresql.org> | 2017-03-14 11:51:11 -0400 |
|---|---|---|
| committer | Robert Haas <rhaas@postgresql.org> | 2017-03-14 11:51:11 -0400 |
| commit | 87f99820349bbb020d1d65dd739a910c6f9c813b (patch) | |
| tree | 83e104228ddaadc71e71a7b730b12d4e709432d3 /src/include/storage/buf_internals.h | |
| parent | 37289ffdbfc7319a3cdb271b11227bf682f76d90 (diff) | |
| download | postgresql-87f99820349bbb020d1d65dd739a910c6f9c813b.tar.gz | |
Fix failure to mark init buffers as BM_PERMANENT.
This could result in corruption of the init fork of an unlogged index
if the ambuildempty routine for that index used shared buffers to
create the init fork, which was true for brin, gin, gist, and hash
indexes.
Patch by me, based on an earlier patch by Michael Paquier, who also
reviewed this one. This also incorporates an idea from Artur
Zakirov.
Discussion: http://postgr.es/m/CACYUyc8yccE4xfxhqxfh_Mh38j7dRFuxfaK1p6dSNAEUakxUyQ@mail.gmail.com
Diffstat (limited to 'src/include/storage/buf_internals.h')
| -rw-r--r-- | src/include/storage/buf_internals.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index d117b66537..ff99f6b5e2 100644 --- a/src/include/storage/buf_internals.h +++ b/src/include/storage/buf_internals.h @@ -64,8 +64,8 @@ #define BM_JUST_DIRTIED (1U << 28) /* dirtied since write started */ #define BM_PIN_COUNT_WAITER (1U << 29) /* have waiter for sole pin */ #define BM_CHECKPOINT_NEEDED (1U << 30) /* must write for checkpoint */ -#define BM_PERMANENT (1U << 31) /* permanent relation (not - * unlogged) */ +#define BM_PERMANENT (1U << 31) /* permanent buffer (not + * unlogged, or init fork) */ /* * The maximum allowed value of usage_count represents a tradeoff between * accuracy and speed of the clock-sweep buffer management algorithm. A |
