From 595bfffa27030c071eb0fa19793b02c301e3dbd0 Mon Sep 17 00:00:00 2001 From: dimitr Date: Sat, 10 May 2003 13:05:26 +0000 Subject: [PATCH] Fixed GC code to avoid [quite frequent] index corruptions. --- src/jrd/vio.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index 27297a6595..927179fb8a 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -3294,7 +3294,6 @@ static void garbage_collect( * because we have the last existing copy of them. * **************************************/ - LLS going; SET_TDBB(tdbb); @@ -3314,7 +3313,7 @@ static void garbage_collect( /* Delete old versions fetching data for garbage collection. */ - going = NULL; + LLS going = NULL; while (rpb->rpb_b_page != 0) { rpb->rpb_record = NULL; @@ -3324,8 +3323,13 @@ static void garbage_collect( if (!DPM_fetch(tdbb, rpb, LCK_write)) BUGCHECK(291); /* msg 291 cannot find record back version */ delete_(tdbb, rpb, prior_page, tdbb->tdbb_default); - if (rpb->rpb_record) + if (rpb->rpb_record) { LLS_PUSH(rpb->rpb_record, &going); + BLB_garbage_collect(tdbb, going, staying, prior_page, rpb->rpb_relation); + IDX_garbage_collect(tdbb, rpb, going, staying); + delete LLS_POP(&going); + going = NULL; + } #ifdef SUPERSERVER /* Don't monopolize the server while chasing long back version chains. */ @@ -3334,12 +3338,6 @@ static void garbage_collect( (void) JRD_reschedule(tdbb, 0, TRUE); #endif } - - BLB_garbage_collect(tdbb, going, staying, prior_page, rpb->rpb_relation); - IDX_garbage_collect(tdbb, rpb, going, staying); - - while (going) - delete LLS_POP(&going); }