Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get open database errors under heavy concurrent load [CORE4644] #4958

Closed
firebird-issue-importer opened this issue Dec 19, 2014 · 6 comments
Closed

Comments

@firebird-issue-importer

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

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.

Commits: ef23fd4 be0c509 FirebirdSQL/fbt-repository@4c49146 FirebirdSQL/fbt-repository@fe2e27b

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 19, 2014

Modified by: @pavel-zotov

Attachment: security-context-error-and-no-such-file-error.zip [ 12654 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 19, 2014

Modified by: @dyemanov

Version: 3.0 Beta 1 [ 10332 ]

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 3, 2015

Modified by: @AlexPeshkoff

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 3, 2015

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.4 [ 10585 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 30, 2015

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Cannot be tested

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 23, 2015

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants