Issue Details (XML | Word | Printable)

Key: CORE-4644
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Pavel Zotov
Votes: 0
Watchers: 2
Operations

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

Get open database errors under heavy concurrent load

Created: 19/Dec/14 07:02 PM   Updated: 23/Sep/15 11:31 AM
Component/s: None
Affects Version/s: 3.0 Beta 1
Fix Version/s: 2.5.4, 3.0 Beta 2

File Attachments: 1. Zip Archive security-context-error-and-no-such-file-error.zip (4 kB)


QA Status: Cannot be tested


 Description  « Hide
LI-T6.3.0.31394 Firebird 3.0 Beta 1, SuperServer.

DDL:
====

DDL:

-- create database 'tmpins.fdb' page_size 8192; commit;
-- than quit + gfix -w async ./tmpins.fdb + connect again

recreate table t(id int primary key using index t_id_pk);
commit;

set term ^;
execute block as
begin
  begin execute statement 'create sequence g'; when any do begin end end
end
^set term ;^
commit;

alter sequence g restart with 0;
commit;

recreate table tlog(
  att int default current_connection,
  dts_beg timestamp,
  dts_end timestamp,
  elapsed_ms computed by ( datediff(millisecond from dts_beg to dts_end) )
);
commit;

recreate exception ex_done 'job has been completed';
commit;

SQL script for each session:
======================
-- file = 'ins_mul_run.sql'
select current_timestamp as dts_start from rdb$database;
set term ^;
execute block
as
  declare n_minutes int = 20;
  declare i int;
  declare n_packet int = 10000;
  declare tb timestamp;
  declare t0 timestamp;
  declare t1 timestamp;
begin
  tb='now';
  while (1=1) do begin
    i=0;
    t0='now';
    ------------------
    in autonomous transaction do
      while( i < n_packet)
        do insert into t(id) values( gen_id(g, 1) ) returning :i+1 into i;
    ------------------
    t1='now';
    in autonomous transaction do
      insert into tlog(dts_beg, dts_end) values( :t0, :t1 );
    
    if ( datediff( minute from :tb to :t1 ) > n_minutes ) then
      exception ex_done;
  end
end
^
set term ;^
commit;
show sequence g;
select current_timestamp as dts_finish from rdb$database;

Batch file for launching ISQLs (with number = 1st argument):
==================

set fbc=C:\1Install\FIREBIRD_2_5\bin
set host=192.168.0.220
set port=3333
set dbnm=/var/db/fb30/tmpins.fdb

@rem path where temp logs will be created:
set tmpdir=c:\temp\ins_mul

md %tmpdir% 2>nul
del %tmpdir%\ins_mul_run_*.log 2>nul
del %tmpdir%\ins_mul_run_*.err 2>nul
if not .%1.==.. set /a winq=%1
if .%winq%.==.0. set winq=10

@echo %time% Recreating DB objects. . .
%fbc%\isql %host%/%port%:%dbnm% -nod -n -i ins_mul_ddl.sql
@echo %time% Done. Now open %winq% sessions. . .
@echo off
for /l %%i in (1, 1, %winq%) do (
  set str=%fbc%\isql %host%/%port%:%dbnm% -nod -n -i ins_mul_run.sql 1^>%tmpdir%\ins_mul_run_%%i.log 2^>%tmpdir%\ins_mul_run_%%i.err
  @rem echo str = !str!
  start /min cmd /c !str!
)
goto end
:end

Test:
====
c:\...> test_ins.bat 100

The following errors *can* (rarely) appear in trace for this test:

2014-11-20T17:31:17.3780 (11984:0x7f31fb952b40) ERROR AT JProvider::attachDatabase
/var/db/fb30/tmpins.fdb (ATT_0, SYSDBA, NONE, TCPv4:192.168.0.201)
C:\1Install\FIREBIRD_2_5\bin\isql.exe:11512
335545060 : Missing security context for /var/db/fb30/tmpins.fdb

And:

2014-11-20T17:31:19.3440 (11984:0x7f30af975d90) ERROR AT JProvider::attachDatabase
/var/db/fb30/tmpins.fdb (ATT_0, SYSDBA, NONE, TCPv4:192.168.0.201)
C:\1Install\FIREBIRD_2_5\bin\isql.exe:7500
335544344 : I/O error during "open" operation for file "/var/db/fb30/tmpins.fdb"
335544734 : Error while trying to open file
        2 : No such file or directory

After Alex suggestion I've change jrd/Mapping.cpp and specified there:

#define MAP_DEBUG(A) A

Than I run FB as application and redirected its output to file - see attach.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.