Issue Details (XML | Word | Printable)

Key: CORE-5179
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Pavel Zotov
Votes: 0
Watchers: 1
Operations

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

Database-level statistics (MON$STAT_GROUP = 0) may contain multiple rows under concurrent load

Created: 30/Mar/16 02:41 PM   Updated: 06/Apr/16 06:41 AM
Component/s: Engine
Affects Version/s: 3.0 RC1, 3.0 RC2, 4.0 Initial
Fix Version/s: 3.0.0, 4.0 Alpha 1

File Attachments: 1. File multiple_rows_in_singleton_when_select_from_mon-io_stats_where_mon-stat_group_equ_0.7z (199 kB)
2. File test-concurrent-querying-to-mon_io.7z (1 kB)

Environment:
Clients: two host, OS = Win XP, fbclient.dll:
1) WI-T4.0.0.86
2) WI-T4.0.0.77

Checked on server (oel64) :
1) LI-V3.0.0.32366
2) LI-T4.0.0.32400

NB: arch = #Classic# server in both cases.


QA Status: 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.


 Description  « Hide
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.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Zotov added a comment - 30/Mar/16 02:47 PM
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).

Dmitry Yemanov added a comment - 31/Mar/16 10:55 AM
Fixed in v4.0, please test it thoroughly to allow backporting into v3.0.