Bug 1392041

Summary: MySQL Cartridge Needs Variable for thread_stack in my.cnf
Product: OpenShift Online Reporter: jonathan.fowlke
Component: ImageAssignee: Rory Thrasher <rthrashe>
Status: CLOSED WONTFIX QA Contact: Wang Haoran <haowang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.xCC: aos-bugs, gpei, jokerman, jonathan.fowlke, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-31 18:22:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description jonathan.fowlke 2016-11-04 15:54:54 UTC
I need to be able to set the thread_stack setting in the my.cnf file for MySQL.  So a OPENSHIFT_MYSQL_THREAD_STACK environmental variable should be introduced.


Running complex MySQL procedures I get the following error:

2016-11-04 11:52:07.414 ERROR 491525 --- [http-nio-127.7.63.129-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [CALL get_ancestry(?)]; SQL state [HY000]; error code [1436]; Thread stack overrun:  138400 bytes used of a 262144 byte stack, and 128000 bytes needed.  Use 'mysqld --thread_stack=#' to specify a bigger stack.; nested exception is java.sql.SQLException: Thread stack overrun:  138400 bytes used of a 262144 byte stack, and 128000 bytes needed.  Use 'mysqld --thread_stack=#' to specify a bigger stack.] with root cause

Comment 2 Rory Thrasher 2016-11-07 21:03:38 UTC
Hi Jonathan,

Does the same error occur when doing simpler MySQL queries?  It may be that your query is using more memory that your gear has access to.  If this is the case, then you may want to split your complex query into a number of smaller/simpler queries.  Alternatively, upgrading to a Bronze plan will allow you to create Medium/Large gears which will have more memory (1GB/2GB respectively as opposed to the small gear's 512MB).

If the error is still occurring on simpler MySQL queries then let me know and I'll look deeper into what's causing this and investigate a possible environment variable.


Thank you,
Rory

Comment 3 jonathan.fowlke 2016-11-08 17:13:00 UTC
The SQL query I'm running is a recursive procedure.  It alone throws the error.  I understand that the Gear I'm running it on has limited memory, but that's not the issue.  On my local machine it throws this same error where I give it all the memory it wants; the issue is the thread_stack size.  Currently, your my.cnf sets the thread_stack size to "256K", I just want to be able to set it to something like "2M".  That's how I fixed this procedure locally.  How can I configure MySQL to do this?

Comment 4 Eric Paris 2017-05-31 18:22:11 UTC
We apologize, however, we do not plan to address this report at this time. The majority of our active development is for the v3 version of OpenShift. If you would like for Red Hat to reconsider this decision, please reach out to your support representative. We are very sorry for any inconvenience this may cause.