Last modified: 2014-01-22 11:22:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49135, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47135 - term_row_id field needs to be converted to a BIGINT.
term_row_id field needs to be converted to a BIGINT.
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
backlog
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-11 19:27 UTC by Daniel Kinzler
Modified: 2014-01-22 11:22 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2013-04-11 19:27:51 UTC
term_row_id is currently declared as "INT", which in MySQL is a signed 32 bit integer. On wikidata.org, this field has already reached 83 Million, once it hits 2 Billion, it will overflow. Note that this is an auto-increment field, so it essentially counts how many rows were inserted into the table - this number will hit the 31 bit limit much faster than the size of the table would.

The solution is to declare the term_row_id to be an UNSIGNED BIGINT (full 64 bit). That should give us some head room.

We need to consult with ops about how to perform the conversion on the live site.
Comment 1 Sam Reed (reedy) 2013-04-11 19:32:00 UTC
[20:29:12] <Reedy> Surely INT -> BIGINT should be quick at the database level?
[20:29:21] <Reedy> Nothing needs to actually change..
[20:30:26] <Reedy> That and it has a PK so should work with OSC
Comment 2 Brion Vibber 2013-04-11 21:10:28 UTC
Couple reminders:

* if any 32-bit machines remain in the cluster, integers will potentially be 32-bit and esplode

* if any JavaScript code needs to work with these IDs as numbers, they'll be limited to ~53 bits since numbers are represented as double-precision floats.

As long as 32-bit machines are all gone, shouldn't have trouble though. It'll take a while to hit 53 bits... I hope. :) [This was a big problem on Twitter a couple years ago, they had to add string fields to allow processing IDs as strings.]
Comment 3 Aaron Schulz 2013-04-11 21:11:51 UTC
I don't think we have to worry about us having 32 bit servers, I believe those were gone long ago.
Comment 4 Daniel Kinzler 2013-10-29 16:38:48 UTC
The database setup and upgrade scripts should still be changed to use UNSIGNED BIGINT
Comment 5 Daniel Kinzler 2013-10-29 16:41:09 UTC
The files that needs updates are: 

repo/includes/store/sql/AddRowIDs*sql
repo/includes/store/sql/Wikibase*sql
Comment 6 Gerrit Notification Bot 2013-12-06 12:22:17 UTC
Change 99637 had a related patch set uploaded by Daniel Kinzler:
(bug 47135) Make row IDs use BIGINT.

https://gerrit.wikimedia.org/r/99637
Comment 7 Gerrit Notification Bot 2014-01-08 14:03:45 UTC
Change 99637 merged by jenkins-bot:
(bug 47135) Make row IDs use BIGINT.

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links