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
Resources (e.g. sort files) owned by trigger may not be released when it's interrupted asynchronously [CORE4334] #4657
Comments
Modified by: @pavel-zotovAttachment: fb_sort_files_remain_opened_-_test_case.zip [ 12420 ] |
Commented by: @pavel-zotov PS. |
Modified by: @dyemanovassignee: Dmitry Yemanov [ dimitr ] |
Modified by: @dyemanovVersion: 3.0 Alpha 1 [ 10331 ] Version: 3.0 Alpha 2 [ 10560 ] summary: fb_sort_* files remain opened after forcely detach connect when low value of TempCacheLimit and big size of sorting data => Resources (e.g. sort files) owned by trigger are not released when it's interrupted asynchronously |
Modified by: @dyemanovsummary: Resources (e.g. sort files) owned by trigger are not released when it's interrupted asynchronously => Resources (e.g. sort files) owned by trigger may not be released when it's interrupted asynchronously |
Commented by: @dyemanov I expect it to be fixed now, please verify. |
Commented by: @pavel-zotov Checked (LI-T3.0.0.30876), result: fixed OK, no files remains in temp folder. |
Modified by: @dyemanovstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Beta 1 [ 10332 ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @pavel-zotov
Attachments:
fb_sort_files_remain_opened_-_test_case.zip
Reproduced on:
LI-T3.0.0.30872
WI-T3.0.0.30855
firebird.conf changes: TempCacheLimit = 64K
DDL: see attach, file CROSS.DDL.
####
Please note that this script contains on-commit trigger with some kind of 'heavy' query to MON$-tables:
-- first check uncommitted data in all other transactions:
if (
exists(
with c as(
select
c.mon$transaction_id tid
--,substring(c.mon$variable_name from 3) vn
,cast( substring(c.mon$variable_name from 3) as varchar(16384)) vn
,min(cast( iif( c.mon$variable_name starting with 'ID_NEW', c.mon$variable_value, null) as int) ) ctx_id_new
,min(cast( iif( c.mon$variable_name starting with 'F1_NEW', c.mon$variable_value, null) as int) ) ctx_f1_new
,min(cast( iif( c.mon$variable_name starting with 'F2_NEW', c.mon$variable_value, null) as int) ) ctx_f2_new
from mon$context_variables c
group by 1,2 -- <<<<<<<<<<<<<<<<<< THIS WILL CAUSE 'SORT' in PLAN <<<<<<<<<<
)
select *
from c ca join c cb
on ca.ctx_id_new<>cb.ctx_id_new
and sign(ca.ctx_f1_new - cb.ctx_f2_new) * sign(cb.ctx_f1_new - ca.ctx_f2_new)>0
) -- exists
)
then
exception ex_crossed_dirty;
Also, note that one of field of that query is deliberately casted to long string (16384 chars).
Test:
1) open *single* isql session that runs script CROSS.SQL - see in attach.
2) wait about 10-15 seconds and than kill that session, e.g. via PSKILL utility (from Sysinternals package).
Result: FB keeps one or two FB_SORT_*-files open infinite time untill restart.
Commits: 462cd99 FirebirdSQL/fbt-repository@c611611
The text was updated successfully, but these errors were encountered: