fb_sort_* files remain opened after forcely detach connect when low value of 
TempCacheLimit and big size of sorting data
------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-4334
                 URL: http://tracker.firebirdsql.org/browse/CORE-4334
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
            Reporter: 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. 


-- 
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

        

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to