Issue Details (XML | Word | Printable)

Key: CORE-4565
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Pavel Zotov
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

GDSCODE can have value = 0 in WHEN-section under some concurrent env., only in SC or CS (not in SS)

Created: 30/Sep/14 03:21 PM   Updated: 09/Feb/18 10:33 AM
Component/s: None
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1, 2.5.9

QA Status: Deferred
Test Details: Letters to / from Vlad: 29-sep-2014. As he said, this bug could be reproduced in the single attachment, w/o concurrent attachments. Hope that such test will be implemented.
Test Specifics: Architecture (SS/CS) specific


 Description  « Hide
Sample of code:

create or alter procedure sp_handle_rows (
    a_doc_id bigint,
    a_old_optype bigint)
as
    declare v_gdscode int;
    declare v_dd_id bigint;
    declare v_this varchar(80) = 'sp_handle_rows';
begin

    for
        select d.id
        from doc_data d
        where d.doc_id = :a_doc_id
        into v_dd_id
    do
    begin
        delete from qdistr q
        where
            q.snd_optype_id = :a_old_optype
            and q.rcv_optype_id in ( 1200, 3300 )
            and q.snd_id = :v_dd_id;
    end

when any do
    begin
        v_gdscode = gdscode;
        if ( v_gdscode not in( 335544336, 335544878 ) ) then
        begin
            in autonomous transaction do
            insert into perf_log(
                unit,
                fb_gdscode)
            values(
                :v_this,
                :v_gdscode);
        end

        exception;

    end

end

Here it might be that in WHEN ANY section value of `gdscode` variable can be 0 (ZERO) rather than one that reflects lock-conflict.
This occurs only in SuperCLASSIC (and only in 3.x) and never in SuperServer.
Two or more concurrent attaches must work at the same data of table QDistr. After some time record in log table ('PERF_LOG') will appear with fb_gdscode = 0.

I've sent full test to Vlad, got from him instruction where to update source and hope that this will work OK (currently testing it; final report will be later).

PS. Many thanks to Vlad. This was headache during last two monthes.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun made changes - 30/Sep/14 03:37 PM
Field Original Value New Value
Assignee Vlad Khorsun [ hvlad ]
Vlad Khorsun made changes - 01/Oct/14 06:17 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0 Beta 1 [ 10332 ]
Resolution Fixed [ 1 ]
Pavel Zotov made changes - 02/Jun/15 05:19 AM
Status Resolved [ 5 ] Resolved [ 5 ]
Test Specifics [Architecture (SS/CS) specific]
Test Details Letters to / from Vlad: 29-sep-2014. As he said, this bug could be reproduced in the single attachment, w/o concurrent attachments. Hope that such test will be implemented.
QA Status Deferred
Pavel Cisar made changes - 23/Sep/15 11:29 AM
Status Resolved [ 5 ] Closed [ 6 ]
Vlad Khorsun made changes - 09/Feb/18 10:33 AM
Fix Version/s 2.5.9 [ 10862 ]