Server could hang during chasing dead record version
----------------------------------------------------

                 Key: CORE-4656
                 URL: http://tracker.firebirdsql.org/browse/CORE-4656
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.3 Update 1, 3.0 Beta 1, 2.5.3, 2.5.2 Update 1, 2.5.2, 
3.0 Beta 2, 3.0 RC 1, 3.0.0
            Reporter: Dmitriy Starodubov


In VIO_chase_record_version:
if (!(rpb->rpb_flags & rpb_chained) && rpb->rpb_flags & rpb_gc_active)
{
        if (!rpb->rpb_transaction_nr) {
                state = tra_active;
        }

        if (state == tra_committed) {
                state = TRA_pc_active(tdbb, rpb->rpb_transaction_nr) ? 
tra_precommitted : tra_dead;
        }

        if (state == tra_dead) {
                rpb->rpb_flags &= ~rpb_gc_active;
        }
}
If state is dead and record has rpb_gc_active flag turned on, this flag is 
reset and starts new iteration of chasing.
On new iteration if ATT_NO_CLEANUP flag turned on, version is read from disk 
again and compared with saved version:

record_param temp = *rpb;
...
    VIO_data(tdbb, rpb, pool);
    rpb->rpb_page = temp.rpb_page;
    rpb->rpb_line = temp.rpb_line;
    if (!(DPM_fetch(tdbb, rpb, LCK_read)))
    {
        if (!DPM_get(tdbb, rpb, LCK_read)) {
            return false;
        }
        break;
    }

    if (rpb->rpb_b_page != temp.rpb_b_page || rpb->rpb_b_line != 
temp.rpb_b_line ||
        rpb->rpb_f_page != temp.rpb_f_page || rpb->rpb_f_line != 
temp.rpb_f_line ||
        rpb->rpb_flags != temp.rpb_flags)
    {
        CCH_RELEASE(tdbb, &rpb->getWindow(tdbb));
        if (!DPM_get(tdbb, rpb, LCK_read)) {
            return false;
        }
        break;
    }
"rpb" and "temp" versions can differ only by rpb_gc_active flag which was reset 
from saved version on previous iteration. Because of this current version 
considered as changed and it processed again. And so on. Loop inside 
VIO_chase_record_version becomes infinite.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to