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

Engine could freeze up to 2 minutes and raise deadlock error when updating RDB$INDICES if it contains backversions [CORE5522] #5791

firebird-automations opened this issue Apr 16, 2017 · 3 comments


Copy link

Submitted by: @hvlad

Test case

1. create backversions in rdb$indices and make hard rollback to leave it on disk:

delete from t_tx;
insert into t_tx select 1 from rdb$types, rdb$types;
insert into t_tx select 1 from rdb$types, rdb$types;
update rdb$indices set rdb$index_inactive = -1;

2. Try to set stats for all indices:
update rdb$indices set rdb$index_inactive = -1;

Statement failed, SQLSTATE = 40001

Call stack
> fb_inet_server.exe!latch_bdb(tdbb=0x035cf4d4, type=LATCH_exclusive, bdb=0x043a1478, page={...}, latch_wait=1) Line 5464 C++
fb_inet_server.exe!get_buffer(tdbb=0x035cf4d4, page={...}, latch=LATCH_exclusive, latch_wait=1) Line 4872 C++
fb_inet_server.exe!CCH_fetch_lock(tdbb=0x035cf4d4, window=0x044d8c10, lock_type=6, wait=1, page_type='') Line 889 C++
fb_inet_server.exe!CCH_FETCH_LOCK(tdbb=0x035cf4d4, window=0x044d8c10, lock_type=6, wait=1, page_type='') Line 91 C++
fb_inet_server.exe!CCH_handoff(tdbb=0x035cf4d4, window=0x044d8c10, page=85, lock=6, page_type='', latch_wait=1, release_tail=false) Line 1618 C++
fb_inet_server.exe!CCH_HANDOFF(tdbb=0x035cf4d4, window=0x044d8c10, page=85, lock=6, page_type='') Line 121 C++
fb_inet_server.exe!DPM_get(tdbb=0x035cf4d4, rpb=0x044d8bb8, lock_type=6) Line 1449 C++
fb_inet_server.exe!VIO_backout(tdbb=0x035cf4d4, rpb=0x044d8bb8, transaction=0x0338796c) Line 406 C++
fb_inet_server.exe!VIO_chase_record_version(tdbb=0x035cf4d4, rpb=0x044d8bb8, transaction=0x0338796c, pool=0x044d9ea0, writelock=false) Line 859 C++
fb_inet_server.exe!VIO_get(tdbb=0x035cf4d4, rpb=0x044d8bb8, transaction=0x0338796c, pool=0x044d9ea0) Line 1871 C++
fb_inet_server.exe!get_record(tdbb=0x035cf4d4, rsb=0x044d82ac, parent_rsb=0x044d824c, mode=RSE_get_forward) Line 1887 C++
fb_inet_server.exe!get_record(tdbb=0x035cf4d4, rsb=0x044d824c, parent_rsb=0x00000000, mode=RSE_get_forward) Line 2156 C++
fb_inet_server.exe!fetch_record(tdbb=0x035cf4d4, rsb=0x044d837c, n=0) Line 775 C++
fb_inet_server.exe!get_record(tdbb=0x035cf4d4, rsb=0x044d837c, parent_rsb=0x00000000, mode=RSE_get_forward) Line 2339 C++
fb_inet_server.exe!RSE_get_record(tdbb=0x035cf4d4, rsb=0x044d837c, mode=RSE_get_forward) Line 312 C++
fb_inet_server.exe!EXE_looper(tdbb=0x035cf4d4, request=0x044d8830, in_node=0x044da180) Line 1989 C++
fb_inet_server.exe!looper_seh(tdbb=0x035cf4d4, request=0x044d8830, node=0x044da180) Line 2917 C++
fb_inet_server.exe!execute_looper(tdbb=0x035cf4d4, request=0x044d8830, transaction=0x0338796c, node=0x044da180, next_state=req_proceed) Line 1369 C++
fb_inet_server.exe!EXE_send(tdbb=0x035cf4d4, request=0x044d8830, msg=0, length=32, buffer=0x035ce944) Line 971 C++
fb_inet_server.exe!MET_lookup_partner(tdbb=0x035cf4d4, relation=0x03385490, idx=0x035cea54, index_name=0x00000000) Line 3796 C++
fb_inet_server.exe!IDX_modify_flag_uk_modified(tdbb=0x035cf4d4, org_rpb=0x044cb9d8, new_rpb=0x044cba48, transaction=0x0441c008) Line 1699 C++
fb_inet_server.exe!VIO_modify(tdbb=0x035cf4d4, org_rpb=0x044cb9d8, new_rpb=0x044cba48, transaction=0x0441c008) Line 2509 C++
fb_inet_server.exe!modify(tdbb=0x035cf4d4, node=0x044cc3a0, which_trig=0) Line 3008 C++
fb_inet_server.exe!EXE_looper(tdbb=0x035cf4d4, request=0x044cb650, in_node=0x044cbf84) Line 2564 C++

Commits: ce8b27f 7c228d8

Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

Copy link
Collaborator Author

Commented by: @hvlad

V3.0 and V4.0 is not affected as almost same patch was already committed at year 2010

Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.8 [ 10809 ]

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

No branches or pull requests

2 participants