Bug #34085 create table on falcon hangs when it cannot allocate memory for the page cache
Submitted: 27 Jan 2008 3:39 Modified: 18 Oct 2008 15:19
Reporter: Mark Callaghan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.3-alpha OS:Any
Assigned to: Vladislav Vaintroub CPU Architecture:Any
Tags: create, falcon, hang, table

[27 Jan 2008 3:39] Mark Callaghan
Description:
I used a 32-bit server and over-subscribed memory with a 2G InnoDB buffer cache and 2G for Falcon. When I did 'create table f(d double primary key) engine=falcon', the statement hung.

I prefer that Falcon try to get any resources it needs at server startup. That would make config problems more obvious and less of a risk.

The settings were:

innodb_buffer_pool_size=2G
falcon_record_memory_max=200M
falcon_page_cache_size=1800M

Everything was fine after changing the settings to:
innodb_buffer_pool_size=1G
falcon_record_memory_max=200M
falcon_page_cache_size=800M

How to repeat:
described above

Suggested fix:
Allocate memory at engine init time and raise an error then rather than making a user session run into the problem.
[28 Jan 2008 9:40] Sveta Smirnova
Thank you for the report.

Verified as described.
[28 Jan 2008 9:51] Sveta Smirnova
Additionally if I kill server, then change settings, restart server again and issue 'use db_where_I_tried_to_create-such_table' server hangs
[24 Feb 2008 15:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/42919

ChangeSet@1.2822, 2008-02-24 16:48:01+01:00, vvaintroub@wva. +2 -0
  Bug#34085 - create table on falcon hangs if it cannot allocate pagecache
  In this case, pagecache size was too big, initialization failed and user 
  was confronted with incomprehensible error message from CREATE TABLE.
  
  Solution : now Falcon will be initialized at database startup. Plugin 
  will not be loaded on failed allocation and this will make configuration
  issues more obvious to DBA.
[25 Feb 2008 15:26] Kevin Lewis
Q.  Why did you take out  "if (storageHandler)" 3 places in ha_falcon.cpp?
A.  Cleanup.  If plugin is not loaded, no other function except falcon_init() is called and falcon variables are not visible.

Patch Approved.
[12 Mar 2008 23:02] Bugs System
Pushed into 6.0.4-alpha
[13 Mar 2008 15:55] Hakan Küçükyılmaz
Fix is in 6.0.5-alpha.
[18 Oct 2008 15:19] Jon Stephens
Documented bugfix in the 6.0.5 changelog as follows:

        CREATE TABLE ... ENGINE=Falcon failed with an unhelpful error message
        when the Falcon storage engine had failed to allocate the page cache
        properly on server startup. Now Falcon is initialized on server startup,
        and is not loaded if the allocation fails.