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

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 (4 kB)

QA Status: Cannot be tested

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



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

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

alter sequence g restart with 0;

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

recreate exception ex_done 'job has been completed';

SQL script for each session:
-- file = 'ins_mul_run.sql'
select current_timestamp as dts_start from rdb$database;
set term ^;
execute block
  declare n_minutes int = 20;
  declare i int;
  declare n_packet int = 10000;
  declare tb timestamp;
  declare t0 timestamp;
  declare t1 timestamp;
  while (1=1) do begin
    in autonomous transaction do
      while( i < n_packet)
        do insert into t(id) values( gen_id(g, 1) ) returning :i+1 into i;
    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;
set term ;^
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=
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

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:
335545060 : Missing security context for /var/db/fb30/tmpins.fdb


2014-11-20T17:31:19.3440 (11984:0x7f30af975d90) ERROR AT JProvider::attachDatabase
/var/db/fb30/tmpins.fdb (ATT_0, SYSDBA, NONE, TCPv4:
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.