[MCOL-707] GROUP_CONCAT function on TEXT/TEXT got ColumnStore stuck in "Join or subselect exceeds memory limit" error Created: 2017-05-08 Updated: 2017-05-12 Resolved: 2017-05-10 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | 1.1.0 |
| Fix Version/s: | 1.1.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Lee (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Sprint: | 2017-10 | ||||||||
| Description |
|
Build tested: Github source [root@localhost mariadb-columnstore-server]# git show Merge pull request #50 from mariadb-corporation/10.2-fixes 10.2 fixes [root@localhost mariadb-columnstore-server]# cd mariadb-columnstore-engine/ Merge pull request #169 from mariadb-corporation/ Test queries are at the end of this comment. The following query would cause this the "Sorting length Exceeded" error: (query #22) MariaDB [mytest]> select cidx, CTEXT, GROUP_CONCAT(CTEXT) from datatypetestm group by cidx, CTEXT order by cidx; The following query would cause this the "Aggregation/Distinct memory limit Exceeded" error: (query #23) If I execute the script that include the following 45 queries, ColumnStore would get into a condition that it will return a "IDB-2001: Join or subselect exceeds memory limit." even if I just execute a select count MariaDB [mytest]> select count MariaDB [mytest]> create table t2 (c1 int) engine=columnstore; I need to restart the system to get out of this condition. select GROUP_CONCAT(CCHAR2) from datatypetestm; |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2017-05-09 ] | |
|
The cause will be some kind of query with a join or subselect that will trigger that error. Then for some reason that error gets stuck. It doesn't look like any of those queries meets the criteria so it likely happened before you executed them. | |
| Comment by Daniel Lee (Inactive) [ 2017-05-09 ] | |
|
Running these statements in a script caused this error condition. I restarted the system and verified simple queries were executed successfully. Once I executed this script, ColumnStore stuck in this condition. | |
| Comment by Andrew Hutchings (Inactive) [ 2017-05-09 ] | |
|
After some debugging I found this query is executing the offending join:
| |
| Comment by Daniel Lee (Inactive) [ 2017-05-09 ] | |
|
As I mentioned in the ticket, this query returned the "Aggregation/Distinct memory limit is exceeded." error. I was still able to run a "select count" query after that. It was later that ColumnStore got stuck in the "Join or subselect exceeds memory limit." error. | |
| Comment by Andrew Hutchings (Inactive) [ 2017-05-09 ] | |
|
The problem is twofold: 1. We get the errors ("Aggregation/Distinct memory limit Exceeded" from ExeMgr and "Join or subselect exceeds memory limit" from PrimProc) at the same time You will be able to continue after point 1 until you start a new session (I haven't quite figured out why yet, but probably not important). I believe what is happening is in PrimProc the error code and attempted memory usage is getting stuck in resource manager after the initial error. The initial error itself is probably valid but I will see if there is a workaround. | |
| Comment by Daniel Lee (Inactive) [ 2017-05-09 ] | |
|
I agree that the initial error is probably valid. When the query that caused this error exits, resource should be released and subsequent simple queries should be able to get executed. | |
| Comment by Andrew Hutchings (Inactive) [ 2017-05-10 ] | |
|
This bug is different to what I originally thought and over a long period of time could affect 1.0 too. This is what is happening:
This can happen in 1.0 in theory if a query somehow hits "Aggregation/Distinct memory limit Exceeded" or a couple of similar errors many times. It is just massively magnified by LONGTEXT. | |
| Comment by David Hall (Inactive) [ 2017-05-10 ] | |
|
After testing for 1.1, this should be put back into the queue for a fix in 1.0 | |
| Comment by Andrew Hutchings (Inactive) [ 2017-05-10 ] | |
|
No need, I forked | |
| Comment by Daniel Lee (Inactive) [ 2017-05-10 ] | |
|
Build tested: Github source Still having the same issue. It can be reproduced by running the following queries in a .sql script or pasted to the sql client. select cidx, CLONGTEXT, GROUP_CONCAT(CLONGTEXT,CCHAR3) from datatypetestm group by cidx, CLONGTEXT ; It seems to be a timing issue. If I run these queries one at a time manually, it does not have the "stuck" issue. ERROR 1815 (HY000): Internal error: IDB-2003: Aggregation/Distinct memory limit is exceeded. | |
| Comment by Andrew Hutchings (Inactive) [ 2017-05-10 ] | |
|
Additional commit to fix "order by" memory accounting in the same way as found in Daniel's tests. | |
| Comment by Daniel Lee (Inactive) [ 2017-05-10 ] | |
|
Build verified: Github source 1.1.0 [root@localhost mariadb-columnstore-server]# git show Merge pull request #50 from mariadb-corporation/10.2-fixes 10.2 fixes [root@localhost mariadb-columnstore-server]# cd mariadb-columnstore-engine/ Merge pull request #181 from mariadb-corporation/ Repeated GROUP_CONCAT test case and issue has been fixed. |