Fix MySQL warning about bugscache fulltext index ("InnoDB rebuilding table to add column FTS_DOC_ID")

RESOLVED FIXED

Status

Tree Management
Treeherder: Docs & Development
P3
normal
RESOLVED FIXED
10 months ago
2 months ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

10 months ago
Seen whilst running `PYTHONWARNINGS=once pytest` from the Vagrant environment.

tests/test_setup.py::test_no_missing_migrations

  /home/vagrant/python/lib/python2.7/site-packages/django/db/backends/mysql/base.py:101: Warning: ('124', 'InnoDB rebuilding table to add column FTS_DOC_ID')
    return self.cursor.execute(query, args)

This is triggered during the migrations that are run for each test:
https://github.com/mozilla/treeherder/blob/63a6692e718e2a4776a948ce85f5c18177f36ce6/treeherder/model/migrations/0001_squashed_0053_add_job_platform_option_push_index.py#L661-L665

See:
https://dev.mysql.com/doc/refman/5.7/en/innodb-fulltext-index.html#innodb-fulltext-index-docid

This warning is mostly not relevant to us, since for the tests, the table is empty at the time the fulltext index is added, so the cost of adding the FTS_DOC_ID is minimal. And in production, the fulltext index has existed forever, so not a problem.

Options appear to be:
1) Just suppress the warning (eg `sql_notes = 0` whilst running that manual SQL, and I guess having to set it back to `1` again after, since otherwise it will persist for the re-used session)
2) Create the index at the same time as the table, either by:
  (a) Moving the entire table creation to manual SQL.
  (b) Trying to add fulltext index support to the Django ORM. Though this was ~wontfixed (https://code.djangoproject.com/ticket/26990) so would mean custom Django classes living in Treeherder or similar, so probably not worth it.
(Assignee)

Updated

9 months ago
Component: Treeherder → Treeherder: Docs & Development

Comment 1

2 months ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/4dee8425d98d5faa899c52a825b82915632df2f2
Bug 1389548 - Fix MySQL warning about rebuilding bugscache table

Avoids this warning being printed after every pytest invocation:
`Warning: ('124', 'InnoDB rebuilding table to add column FTS_DOC_ID')`
(Assignee)

Updated

2 months ago
Assignee: nobody → emorley
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → FIXED

Comment 3

2 months ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/5f2cc87d7647169ead5e4aece2523ab92afa9ec5
Bug 1389548 - Vagrant: Remove migrate stderr redirect (#3442)

The workaround is no longer required now that the MySQL warning
has been suppressed in the migration file itself.
You need to log in before you can comment on or make changes to this bug.