From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix data loss on crash after sorted GiST index build. |
Date: | 2022-02-24 14:32:53 |
Message-ID: | E1nNFAq-000Aa1-Lq@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix data loss on crash after sorted GiST index build.
If a checkpoint happens during the index build, and the system crashes
after the checkpoint and the index build have finished, the data written
to the index before the checkpoint started could be lost. The checkpoint
won't have fsync'd it, and it won't be replayed at crash recovery either.
Fix by calling smgrimmedsync() after the index build, just like in B-tree
index build.
Backpatch to v14 where the sorted GiST index build was introduced.
Reported-by: Melanie Plageman
Discussion: https://www.postgresql.org/message-id/CAAKRu_ZJJynimxKj5xYBSziL62-iEtPE+fx-B=JzR=jUtP92mw@mail.gmail.com
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/7d80e93fb1f1059ba3691b2584bb16992d7d734e
Modified Files
--------------
src/backend/access/gist/gistbuild.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Gustafsson | 2022-02-24 19:59:21 | pgsql: Guard against reallocation failure in pg_regress |
Previous Message | Michael Paquier | 2022-02-24 07:55:47 | pgsql: Simplify more checks related to set-returning functions |