|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.108 1999/06/10 14:17:07 vadim Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.109 1999/06/11 09:35:08 vadim Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -1353,8 +1353,33 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
1353 | 1353 | Ptp.t_data = (HeapTupleHeader) PageGetItem(Ppage, Pitemid);
|
1354 | 1354 | Assert(ItemPointerEquals(&(vtld.new_tid),
|
1355 | 1355 | &(Ptp.t_data->t_ctid)));
|
1356 |
| - Assert(Ptp.t_data->t_xmax == tp.t_data->t_xmin); |
1357 |
| - |
| 1356 | + /* |
| 1357 | + * Read above about cases when !ItemIdIsUsed(Citemid) |
| 1358 | + * (child item is removed)... Due to the fact that |
| 1359 | + * at the moment we don't remove unuseful part of |
| 1360 | + * update-chain, it's possible to get too old |
| 1361 | + * parent row here. Like as in the case which |
| 1362 | + * caused this problem, we stop shrinking here. |
| 1363 | + * I could try to find real parent row but want |
| 1364 | + * not to do it because of real solution will |
| 1365 | + * be implemented anyway, latter, and we are too |
| 1366 | + * close to 6.5 release. - vadim 06/11/99 |
| 1367 | + */ |
| 1368 | + if (Ptp.t_data->t_xmax != tp.t_data->t_xmin) |
| 1369 | + { |
| 1370 | + if (freeCbuf) |
| 1371 | + ReleaseBuffer(Cbuf); |
| 1372 | + freeCbuf = false; |
| 1373 | + ReleaseBuffer(Pbuf); |
| 1374 | + for (i = 0; i < num_vtmove; i++) |
| 1375 | + { |
| 1376 | + Assert(vtmove[i].vpd->vpd_offsets_used > 0); |
| 1377 | + (vtmove[i].vpd->vpd_offsets_used)--; |
| 1378 | + } |
| 1379 | + num_vtmove = 0; |
| 1380 | + elog(NOTICE, "Too old parent tuple found - can't continue vc_rpfheap"); |
| 1381 | + break; |
| 1382 | + } |
1358 | 1383 | #ifdef NOT_USED /* I'm not sure that this will wotk properly... */
|
1359 | 1384 | /*
|
1360 | 1385 | * If this tuple is updated version of row and it
|
@@ -1382,6 +1407,8 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
1382 | 1407 | freeCbuf = true;
|
1383 | 1408 | break;
|
1384 | 1409 | }
|
| 1410 | + if (num_vtmove == 0) |
| 1411 | + break; |
1385 | 1412 | }
|
1386 | 1413 | if (freeCbuf)
|
1387 | 1414 | ReleaseBuffer(Cbuf);
|
|
0 commit comments