8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00

Front ported fix for bug CORE-4372 : Deadlock is possible when two data pages contains record fragments pointing to each other

This commit is contained in:
hvlad 2014-05-16 10:53:28 +00:00
parent db963fdc18
commit 714c151a2d

View File

@ -3018,6 +3018,14 @@ static rhd* locate_space(thread_db* tdbb,
if (dp_number && !PPG_DP_BIT_TEST(bits, slot, ppg_dp_full) && if (dp_number && !PPG_DP_BIT_TEST(bits, slot, ppg_dp_full) &&
((type == DPM_primary) ^ dp_is_secondary)) ((type == DPM_primary) ^ dp_is_secondary))
{ {
// hvlad: to avoid deadlocks in DPM_fetch_fragment enforce ascending
// order of pages for record fragments
if (rpb->rpb_flags & rpb_fragment && type == DPM_other &&
rpb->rpb_page > dp_number)
{
continue;
}
CCH_HANDOFF(tdbb, window, dp_number, LCK_write, pag_data); CCH_HANDOFF(tdbb, window, dp_number, LCK_write, pag_data);
UCHAR* space = find_space(tdbb, rpb, size, stack, record, type); UCHAR* space = find_space(tdbb, rpb, size, stack, record, type);
if (space) if (space)