Issue Details (XML | Word | Printable)

Key: CORE-2184
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Ross Bunker
Votes: 0
Watchers: 3
Operations

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

Superserver hangs when multiple clients create tables simultaneously

Created: 12/Nov/08 02:48 PM   Updated: 26/Jan/09 11:34 AM
Component/s: Engine
Affects Version/s: 2.1.0, 2.1.1
Fix Version/s: 2.1.2

Time Tracking:
Not Specified

Environment: Windows XP SP3
Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
First found when doing multi-threading work in our application where we spin up multiple simultaneous connections to the same database.
I was able to isolate to a simple repro scenario using isql.

1) Open a command prompt
2) cd to \Program Files\Firebird\Firebird_2_1
3) run the following command line
for /L %i in (1,1,16) do start cmd.exe /c "echo CONNECT examples\empbuild\EMPLOYEE.FDB; CREATE TABLE "#TEST_%i_Connect" ("COL" INTEGER); DROP TABLE "#TEST_%i_Connect"; | bin\isql -u SYSDBA -p masterkey -q"


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Sean Leyne added a comment - 12/Nov/08 06:02 PM
Are the separate connections each trying to create the same table?

Ross Bunker added a comment - 12/Nov/08 06:17 PM
No, they are each creating a unique table name. "#TEST_%i_Connect", the %i is replaced by the number 1-16

:)ross

Sean Leyne added a comment - 09/Dec/08 01:22 PM
Have you tried adding a "Commit;" after creating and also dropping the tables?

Dmitry Yemanov added a comment - 10/Dec/08 08:44 AM
This particular deadlock is known and fixed in v2.5. It's easy to backport the bugfix into v2.1.2, if required. But, unfortunately, there are other known issues (crashes, other hangs) caused by simultaneous metadata updates and I'm not sure it's technically possible to backport the whole bunch of the related bugfixes.

Dmitry Yemanov added a comment - 10/Dec/08 09:09 AM
Moreover, it seems that even v2.5 still don't have all the related bugs fixed, as I can reproduce a rare hang with the provided test case.
So I schedule this ticket for v2.5 with a future consideration about porting back into v2.1.x, if it's going to be doable.

Dmitry Yemanov added a comment - 11/Dec/08 04:39 AM
All the appropriate bugfixes have been backported from v2.5, the test case runs without failures in v2.1.2 now.
One kind of the similar issue still looks being reproducible in HEAD, but it seems being an unrelated one and will be tracked independently.

Ross Bunker added a comment - 11/Dec/08 03:12 PM
Thanks so much! You guys rock! I'll get a snapshot ASAP and test it out.
:)ross

Ross Bunker added a comment - 30/Dec/08 03:52 PM
Confirmed fixed in 2.1.2.18108

:)ross