]> granicus.if.org Git - postgresql/commitdiff
Fix possible failure to mark hash metapage dirty.
authorRobert Haas <rhaas@postgresql.org>
Thu, 1 Feb 2018 20:21:13 +0000 (15:21 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 1 Feb 2018 20:23:45 +0000 (15:23 -0500)
Report and suggested fix by Lixian Zou.  Amit Kapila put it
in the form of a patch and reviewed.

Discussion: http://postgr.es/m/151739848647.1239.12528851873396651946@wrigleys.postgresql.org

src/backend/access/hash/hashovfl.c

index c9de1283dca213ff50aecfb42a1473220aba9e2f..2033b2f7f975ac6a0868a08118ec18ea559c8f69 100644 (file)
@@ -341,9 +341,10 @@ found:
                        metap->hashm_mapp[metap->hashm_nmaps] = BufferGetBlockNumber(newmapbuf);
                        metap->hashm_nmaps++;
                        metap->hashm_spares[splitnum]++;
-                       MarkBufferDirty(metabuf);
                }
 
+               MarkBufferDirty(metabuf);
+
                /*
                 * for new overflow page, we don't need to explicitly set the bit in
                 * bitmap page, as by default that will be set to "in use".