Database shutdown can cause server crash if multiple active attachments with 
DML exist
--------------------------------------------------------------------------------------

                 Key: CORE-5087
                 URL: http://tracker.firebirdsql.org/browse/CORE-5087
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0 RC1
            Reporter: Pavel Zotov
         Attachments: shutdown-active-db-batch.zip, 
shutdown-active-db-crash-stacktraces.7z

Scenario (after creating new database with default parameters):
===
1) recreate following DB objects:
1.1) table 'test' with indexed field of type = varchar(N), N = 500
1.2) table 'log4attach' for accumulating info about every attachment that 
occurs;
1.3) DB-level trigger on CONNECT event that will add record into 'log4attach'

2) launch multiple ISQL sessions and give to each .sql script for adding rows 
into 'test' table, but doing that in autonomous RC transaction via ES:

        while (n_limit > 0) do 
        begin
            execute statement ('insert into test(id, s) values( ?, ?)')
                  ( gen_id(g,1), rpad('', :s_length, uuid_to_char(gen_uuid()))  
)
                  with autonomous transaction;
            n_limit = n_limit - 1;
        end
(where  'n_limit'  is some big value, enough for this job last more than a few 
days without interrupting :-))

3) allow ISQL sessions to make their job, take delay about 30-60 seconds; 
ENSURE that every ISQL window will write its STDOUT & STDERR to separate files.

4) issue command that will move database to SHUTDOWN state (either by using 
"FBSVCMGR action_properties dbname ...  prp_shutdown_mode prp_sm_full 
prp_force_shutdown 0" or by "GFIX -shut full -force 0"). All recent FB versions 
ensure that this command runs in synchronous mode, i.e. it will NOT return 
control until all database activity with be really terminated.

5) returns database to ONLINE

6) CHECK that all files that were created by ISQL sessions for storing STDERR 
messages do NOT contain text "SQLSTATE = 08004" (connection rejected by remote 
interface). Optionally: if at least one of  files contains such string - test 
can be stopped.

7) repeat steps 1 ... 6.
===

Test (batch + .sql) is in attached .zip.

Batch accepts two input arguments: 
1) arg_1 = number of launched ISQL sessions which will do loops with ES (INSERT 
statements into table with indexed field of type = varchar(N), N = 500) 
and 
2) arg_2 = time, in seconds, that we allow them to work.

Default values of these arguments (40 and 10) can appear not enough for some 
environment.

As of Linux host with 12 CPU, 32 Gb ram and power IO, I could get result with 
arg_1 = 90 and arg_2 = 35.

After this batch worked during ~ 3 hour I have 58 crashes (they are attached in 
another .7z file).

Tested on: LI-V3.0.0.32294 
Config:
===
Servermode = Super
RemoteServicePort = 3333
DefaultDbCachePages = 2048K
BugCheckAbort=1
AuthClient = Legacy_Auth,Srp,Win_Sspi
AuthServer = Legacy_Auth,Srp
UserManager = Legacy_UserManager
WireCrypt = Disabled
ExternalFileAccess = Restrict /var/db/fb30
FileSystemCacheThreshold = 65536K
LockHashSlots = 22111
MaxUserTraceLogSize = 99999
TempCacheLimit = 2147483647
TempDirectories = /tmp/firebird
===


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to