Page MenuHomePhabricator

Toolforge oursql connecting to enwiki.analytics.db.svc.eqiad.wmflabs raises error 1615 'Prepared statement needs to be re-prepared' but works fine on enwiki.labsdb
Closed, ResolvedPublic

Description

tools.zhuyifei1999-test@tools-bastion-02:~$ cat test.py
import os
import sys

import oursql

conn = oursql.connect(
    sys.argv[1],
    db='enwiki_p',
    read_default_file=os.path.expanduser('~/replica.my.cnf'),
    port=3306)
cursor = conn.cursor()
cursor.execute('SELECT page_id FROM page LIMIT 1;')
tools.zhuyifei1999-test@tools-bastion-02:~$ python test.py enwiki.labsdb
tools.zhuyifei1999-test@tools-bastion-02:~$ python test.py enwiki.analytics.db.svc.eqiad.wmflabs
Traceback (most recent call last):
  File "test.py", line 12, in <module>
    cursor.execute('SELECT page_id FROM page LIMIT 1;')
  File "cursor.pyx", line 122, in oursql.Cursor.execute (oursqlx/oursql.c:16712)
  File "statement.pyx", line 402, in oursql._Statement.execute (oursqlx/oursql.c:10904)
  File "statement.pyx", line 127, in oursql._Statement._raise_error (oursqlx/oursql.c:8082)
oursql.ProgrammingError: (1615, 'Prepared statement needs to be re-prepared', None)

Is this an error on the mariadb's side or oursql?

Event Timeline

Change 386576 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/puppet@production] labsdb-replica: Increase table cache definition

https://gerrit.wikimedia.org/r/386576

Change 386576 merged by Marostegui:
[operations/puppet@production] labsdb-replica: Increase table cache definition

https://gerrit.wikimedia.org/r/386576

Marostegui claimed this task.
Marostegui subscribed.

Fixed it - the table_definition_cache variable was not the same on the new replicas.
Setting it to the same value for the new ones fixed it:

set global table_definition_cache = 50000;
Query OK, 0 rows affected (0.00 sec)
tools.zhuyifei1999-test@tools-bastion-02:~$  python test.py enwiki.analytics.db.svc.eqiad.wmflabs
tools.zhuyifei1999-test@tools-bastion-02:~$