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

Database-level statistics (MON$STAT_GROUP = 0) may contain multiple rows under concurrent load [CORE5179] #5460

Closed
firebird-automations opened this issue Mar 30, 2016 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Attachments:
multiple_rows_in_singleton_when_select_from_mon-io_stats_where_mon-stat_group_equ_0.7z
test-concurrent-querying-to-mon_io.7z

1) Unpack attached .7z, restore fbk.
2) Open "getfbarch.bat" in your text editor and correct settings: specify path to ISQL, host/port of server and path to database file that you've just restored.
3) Copy files "getfbarch.bat" and "getfbarch.sql" in two different folders.
4) Launch "getfbarch.bat" in both directories. It will create log with name "getfbarch.log".
5) Wait 1-5 minutes. Sooner of all, after short time both sessions will be closed, and logs will contain smth. like this:

...
30.03.2016 17:32:27,43. Iter #⁠ 259
30.03.2016 17:32:27,70. Iter #⁠ 260
30.03.2016 17:32:27,98. Finish.
Statement failed, SQLSTATE = 21000
multiple rows in singleton select
After line 1 in file getfbarch.sql

This mean that query:

 select 1 from mon$io\_stats where mon$stat\_group = 0 into n;

===
-- got TWO records, despite that stat_group = 0 is TOP-LEVEL kind of statistics (i.e. it's of the whole database).

Number of iterations that needed for reproducing problem differ: one may to get trouble after 20 but later - wait until 300...400 iterations will pass.

Commits: a441ea9 c3858e1

====== Test Details ======

High concurrent workload with undefined time is required for checking.

Several new issues were found during fix verification but seems that all of them do not relate to ticket subj: build LI-T4.0.0.113 crashed.
Unfortunately, crashes could not be reproduced in 100% (they occur only on my Linux server and Windows PC as client).

Last vers. of test batch+sql see in attached 7z.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: multiple_rows_in_singleton_when_select_from_mon-io_stats_where_mon-stat_group_equ_0.7z [ 12933 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

PS. On database with big size (I have 100 Gb) one may to get exception about "multiple rows" on just first iteration (probability is about 99% if you will run batch with gap about 2-3 seconds while switching between windows).

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 3.0 RC1 [ 10584 ]

Fix Version: 3.0.0 [ 10740 ]

summary: Query "select from mon$io_stats where mon$stat_group = 0" /* __DATABASE__ level statistics*/ can return more than one record when this data is queried by >= 2 attachments => Database-level statistics (MON$STAT_GROUP = 0) may contain multiple rows under concurrent load

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Fixed in v4.0, please test it thoroughly to allow backporting into v3.0.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 4.0 Initial [ 10621 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Cannot be tested

Test Details: High concurrent workload with undefined time is required for checking.

Several new issues were found during fix verification but seems that all of them do not relate to ticket subj: build LI-T4.0.0.113 crashed.
Unfortunately, crashes could not be reproduced in 100% (they occur only on my Linux server and Windows PC as client).

Last vers. of test batch+sql see in attached 7z.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: test-concurrent-querying-to-mon_io.7z [ 12935 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment