Re: BUG #19519: REPACK can fail due to missing chunk for toast value - Mailing list pgsql-bugs

From Imran Zaheer
Subject Re: BUG #19519: REPACK can fail due to missing chunk for toast value
Date
Msg-id CA+UBfa=r2yE7swa_xX9X0y4uq0wury5_AAHr_yHvG3A+9mKzcA@mail.gmail.com
Whole thread
In response to Re: BUG #19519: REPACK can fail due to missing chunk for toast value  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: BUG #19519: REPACK can fail due to missing chunk for toast value
List pgsql-bugs
Hi.

@@ -934,10 +953,17 @@ heapam_relation_copy_for_cluster(Relation
OldHeap, Relation NewHeap,


-                reform_and_rewrite_tuple(tuple,
-                                         OldHeap, NewHeap,
-                                         values, isnull,
-                                         rwstate);
+            {
+                if (!reform_and_rewrite_tuple(tuple,
+                                              OldHeap, NewHeap,
+                                              values, isnull,
+                                              rwstate, true))
+                {
+                    /* TOAST gone for a recently dead tuple */
+                    n_tuples -= 1;
+                    continue;
+                }
+            }


The tuplesort_getheaptuple() will contain both live and recently
deleted tuples. However, the proposed fix passes missing_ok=true for
all tuples coming out of the sort, which means a toast fetch failure
for a LIVE tuple would be acceptable and will be silently skipped. Or
am I missing something?


Thanks
Imran Zaheer



pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #19545: Integer truncation of `GinTuple.keylen` causes out-of-bounds read in parallel GIN index build
Next
From: Peter Eisentraut
Date:
Subject: Re: BUG #19545: Integer truncation of `GinTuple.keylen` causes out-of-bounds read in parallel GIN index build