• Annamalai Gurusami's avatar
    Bug #16244691 SERVER GONE AWAY ERROR OCCURS DEPENDING ON THE NUMBER OF · ff20c67f
    Annamalai Gurusami authored
    TABLE/KEY RELATIONS
    
    Problem:
    
    When there are many tables, linked together through the foreign key
    constraints, then loading one table will recursively open other tables.  This
    can sometimes lead to thread stack overflow.  In such situations the server
    will exit.
    
    I see the stack overflow problem when the thread_stack is 196608 (the default
    value for 32-bit systems).  I don't see the problem when the thread_stack is
    set to 262144 (the default value for 64-bit systems).
    
    Solution:
    
    Currently, in InnoDB, there is a macro DICT_FK_MAX_RECURSIVE_LOAD which defines
    the maximum number of tables that will be loaded recursively because of foreign
    key relations.  This is currently set to 250.  We can reduce this number to 33
    (anything more than 33 does not solve the problem for the default value).  We
    can keep it small enough so that thread stack overflow does not happen for the
    default values.  Reducing the DICT_FK_MAX_RECURSIVE_LOAD will not affect the
    functionality of InnoDB.  The tables will eventually be loaded. 
    
    rb#2058 approved by Marko
    
    ff20c67f
dict0mem.h 21.7 KB