You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- 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.
summary: Get both "335545060 : Missing security context " and "335544344 : I/O error during "open" operation" for existing database under heavy concurrent DML => Get open database errors under heavy concurrent load
Submitted by: @pavel-zotov
Attachments:
security-context-error-and-no-such-file-error.zip
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 );
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.
Commits: ef23fd4 be0c509 FirebirdSQL/fbt-repository@4c49146 FirebirdSQL/fbt-repository@fe2e27b
The text was updated successfully, but these errors were encountered: