Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server could hang during chasing dead record version [CORE4656] #4969

Closed
firebird-issue-importer opened this issue Dec 30, 2014 · 7 comments
Closed

Comments

@firebird-issue-importer

Submitted by: @dmitry-starodubov

Assigned to: @dmitry-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.

Commits: 1c4aeb4 b260c1e FirebirdSQL/fbt-repository@53dc454 FirebirdSQL/fbt-repository@e3b3da1

@firebird-issue-importer
Copy link
Author

Modified by: @dmitry-starodubov

assignee: Dmitriy Starodubov [ dmitriy starodubov ]

@firebird-issue-importer
Copy link
Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-issue-importer
Copy link
Author

Commented by: Jesus Angel Garcia Zarco (cointec)

Will be fixed for 2.5.4?

I trink I have had this problem last week in one of our customers with 2.5.2 upd 1

@firebird-issue-importer
Copy link
Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Cannot be tested

@firebird-issue-importer
Copy link
Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

Commented by: @hvlad

Backported into v2.5.5

@firebird-issue-importer
Copy link
Author

Modified by: @hvlad

Fix Version: 2.5.5 [ 10670 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment