Search code examples
pythonsqlalchemyout-of-memorysinglestore

Memsql query throwing LLVM out of memory compilation error


I have a Python Flask application which is calling memsql to get list of users.

select lower(user_id) as user_id, user_role_list AS user_role from users

The code is throwing below error.

sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (2453, "Leaf Error (durcisplmem08:3306): LLVM Compilation used more memory then the max_compilation_memory_mb system variable or has encountered a compilation failure. Set 'max_compilation_memory_mb' to equal or higher to try recompiling or 'interpreter_mode' session variable to 'mbc' or 'compile_lite' and try running the query again.")

I am using sqlalchemy to connect to memsql

memsql_str = ('mysql://{username}:{password}@{ipaddress}:{port}/{dbname}?charset=utf8mb4'.format(username=MEMSQL_USERNAME,password=MEMSQL_PASSWORD, ipaddress=MEMSQL_ADDRESS, port=MEMSQL_PORT, dbname=MEMSQL_DBNAME))

mem_cnx = create_engine(memsql_str)

sql = "select lower(user_id) as user_id, user_role_list AS user_role from active_rl.dqa_users"

df = pd.read_sql(sql, mem_cnx)

The same query is running smoothly in DBeaver (DB Client). Can someone help me understand whats going wrong. The DBA has also flushed the memory.


Solution

  • The issue later became like I was able to query those tables only 1 time after that the same error was coming back. As per DBA, there was a file system corruption in Memsql server. So fixed that with the help of UNIX Team and restarted the node back. The issue got resolved. This is not a clear solution of actually what was the fix but we got the root cause.