Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 10.0
-
Fix Version/s: 10.0.16
-
Component/s: Storage Engine - Connect
-
Environment:CentOS release 6.5 (X86_64), unixODBC2.2.14(x86_64), Microsoft ODBC Driver 11 for SQL Server
Description
When I set the connect_work_size in /etc/my.cnf.d/connect.cnf
it seems to be set properly but is not working.
It goes alright when I indicate it using the set global command.
When I write inside /etc/my.cnf.d/connect.cnf below,
connect_work_size=536870912
I get in Maria,
show variables like 'connect_work_size'; +-------------------+-----------+ | Variable_name | Value | +-------------------+-----------+ | connect_work_size | 536870912 | +-------------------+-----------+ 1 row in set (0.00 sec)
When inserting into a connect table (SQLServer2005 table on another server),
I get the following error inside /var/lib/mysql/servername.err
PlugSubAlloc: Not enough memory in Work area for request of 80 (used=67108792 free=72)
The size used+free is 64M, whcih is the default connect_work_size.
NOT THE SIZE SET IN MY CNF FILE!
When I set in Maria using the command,
set global connect_work_size=536870912;
the error changes to a correct one as below.
PlugSubAlloc: Not enough memory in Work area for request of 40 (used=536870888 free=24)
Gliffy Diagrams
Attachments
Issue Links
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Takuya Aoki,
As I understand, it's an absolute repetition of
MDEV-6690. In future, please don't create a new bug report if you have new information on an issue previously closed as "Can't reproduce" or "Incomplete"; instead, please comment on the old one and if the information is sufficient to proceed, the issue will be re-open.It's more useful for everyone because it will keep the history of the previous investigation.
This time, I'll keep this one.
Olivier Bertrand,
I can easily reproduce it. The cnf file is not important, you can just as well set the option on the command line.
First, I've made the trace printing unconditional, like this:
=== modified file 'storage/connect/plugutil.c' --- storage/connect/plugutil.c 2014-04-19 09:11:30 +0000 +++ storage/connect/plugutil.c 2014-11-12 16:33:51 +0000 @@ -490,6 +490,9 @@ htrc("SubAlloc in %p size=%d used=%d free=%d\n", memp, size, pph->To_Free, pph->FreeBlk); + if (trace) + htrc("HERE: PlugSubAlloc: used=%d free=%d\n", pph->To_Free, pph->FreeBlk); + if ((uint)size > pph->FreeBlk) { /* Not enough memory left in pool */ char *pname = "Work";Then I ran the server like this, with the non-default connect_work_size and with connect_xtrace:
Then I connected to the server and created a simple Connect table:
And here is what the trace told me:
Note that both the additional output and Memory of ... allocated indicate 67108864.
Then I ran
MariaDB [test]> set global connect_work_size = 536870912; Query OK, 0 rows affected (0.00 sec) MariaDB [test]> select @@connect_work_size; +---------------------+ | @@connect_work_size | +---------------------+ | 536870912 | +---------------------+ 1 row in set (0.00 sec) MariaDB [test]> create table t2 (i int) engine=connect; Query OK, 0 rows affected, 2 warnings (0.17 sec)And got this:
Note that now both the additional and the standard printing show 536870912.
Now, I'm not familiar with the code to debug it further, but I read in
MDEV-6690that you debugged it before and found that internally the value works correctly; if so, maybe it's just the values that are used for output are set incorrectly.