Due to a travel schedule snafu, we need to pull our schema change release day in by one day. The new release date for our schema change release is 14 May, 2014.
Sorry for having to make this change!
MetaBrainz Foundation Community Blog
Due to a travel schedule snafu, we need to pull our schema change release day in by one day. The new release date for our schema change release is 14 May, 2014.
Sorry for having to make this change!
As promised last week, here is a more detailed explanation of what is going to be changing during our May 15th schema change release:
As per our twice a year schedule of making schema changes that impact our Live Data Feed users, I’d like to announce the set of tickets that we’re going to implement for the next release.
We have quite a few clean-up tickets in this batch and a handful of improvements — some of the improvements are a lot of work, but won’t seem that way on the surface. However, the one major new feature we’re going to add are Series. Series will allow us to mark a set of releases as belonging to a series (e.g. Now this is what I call crappy music!). This has been a long long requested feature and we’re finally at a point where we can implement this.
The good news about this release is that a large number of the tickets are already implemented! The big tickets are still in progress, but the smaller ones are already in review. We’re hoping that we’ll have a less hasty push to the finish line this year with lots of time for testing. And we’re hoping for ponies too! 🙂
As promised, here are the instructions for updating any instances of MusicBrainz you might have. You will need to perform these steps to upgrade to the new version:
If your server fails to start or cron is having issues, it may be a missing perl module problem. To check for any missing perl modules, follow the instructions in INSTALL.md.
We’ve just finished rolling out the fall schema change release. Apart from the /place/create endpoint failing, the site is back up in full read-write mode now.
Read on for the changes in this release — our next blog post will give instructions on how to upgrade your instances of MusicBrainz.
Thanks to everyone who worked on this release!
You can check out this release with the following tag: v-2013-10-14 .
Tomorrow, Monday 14 October, 2013, 17:00 UTC (10:00 PDT, 13:00 EDT, 18:00 BST, 19:00 CEST) we’re going to release our next round of schema changes!
As it is typical with our fall schema changes, this one is a little simpler and more focused on cleanup, rather than massive new changes. This gives me hope that we will have smoother release than we did in the spring. 🙂
We’re going to make the site read-only and run off our backup database server while we upgrade our primary database server. I suspect that we should be in read-only mode for about an hour. The exact start time is not quite known — we’ll start our release process at 17:00 UTC, but when we go to read-only is hard to tell. We’ll tweet and give a shout in IRC when we’re ready.
We’ve just completed our extra schema upgrade. The full instructions for upgrade follow:
If you already ran the migration that was announced May 15th, or if you imported a data dump from May 15th or later, skip to the next section.
carton exec -Ilib -- ./admin/replication/LoadReplicationChanges until it cannot apply any packets in schema 16.REPLICATION_TYPE setting is RT_SLAVE in lib/DBDefs.pmgit fetch origin followed by git checkout schema-16-to-17carton install --deployment to install any new perl modules.carton exec -Ilib -- ./upgrade.sh from the top of the source directory.DB_SCHEMA_SEQUENCE to 17 in lib/DBDefs.pmcarton exec -Ilib -- ./admin/replication/LoadReplicationChanges until it cannot apply any packets in schema 17.REPLICATION_TYPE setting is RT_SLAVE in lib/DBDefs.pmgit fetch origin followed by git checkout v-2013-05-24carton exec -Ilib -- ./upgrade.sh from the top of the source directory.DB_SCHEMA_SEQUENCE to 18 in lib/DBDefs.pmNote that the tags to check out for the two migrations are different.
For the list of changes in schema 17, see the former blog post. The changes for schema 18 are:
medium.release that dramatically improves performance.ref_count column of the artist_credit table, which was not updated properly at the schema 16-17 upgrade.On Friday 24 May, 2013 at 15:00UTC we’re going to make an urgent schema update to fix a problem that occurred during our schema change last week. Please read this whole blog post carefully!
This update will not make any changes to the schema, but it will fix some data issues that have appeared on slave servers.
We apologize profusely for these problems — we’re working hard to rectify this problem and we’re going to improve our processes going forward to ensure that future releases will not encounter these problems.
What went wrong
Due to a misunderstanding of our database system, the ‘track’ table will be corrupted on the majority of replicated slave databases after the schema 17 migration. Specifically, depending on the internal choices of a given postgresql installation’s query planner and other system details, any particular server can end up with a variety of incompatible permutations of the track table, where ‘id’/’gid’ pairs will generally point to the incorrect track data. Unfortunately, this problem is compounded by replication, which is based on the ‘id’ column. Therefore, replication packets since the schema change are likely to have deleted and modified the incorrect rows of the ‘track’ table on slaves.
How are we fixing it
In order to ensure that no slaves continue to replicate incompatible changes, we are incrementing the schema number again to 18, which will force operators of slave servers to intervene appropriately. To ensure that slaves have a correct version of the ‘track’ table, we are providing an upgrade script that will download an exported snapshot of the production server’s ‘track’ table at a known point and import it, as well as correct some smaller issues. By importing this snapshot, slave servers will be reset to a correct version of this table and replication can continue.
Specific step by step instructions on running this upgrade will be in a separate blog post. Watch this space!
What problems may have arisen
FAQ about this update
Q: We don’t use the track table, we use recordings. Am I affected?
A: You are not affected if you use recordings directly, i.e., looking up recording information by a stored recording MBID, except if you use track information linked to those recordings (for example, if you create a list of releases a given recording appears on). Since the link between the recording and the release tables is via the ‘track’ table, anything that connects these two entities is likely to be affected.
Q: How can I tell if any of the tracklists I am using are affected?
A: Due to the random permutation issue, it’s not completely possible to be 100% sure. However, it’s possible to know of tracklists that definitely have problems by two means: track counts, and sequence issues. The former can be tested with a fairly simple query: “
SELECT medium.id, medium.track_count, count(track.id) as track_track_count,
medium.track_count count(track.id) AS counts_differ
FROM medium join track on track.medium = medium.id
GROUP BY medium.id, medium.track_count
HAVING count(track.id) medium.track_count;
Any medium that appears in that query has been affected and its tracklist should not be trusted (select ‘medium.release’ to get release IDs, if that’s your jam). Sequence issues are a more complex query:
SELECT distinct m.id FROM
(SELECT DISTINCT medium.* FROM
( SELECT track.medium, min(track.position) AS first_track, max(track.position)
AS last_track, count(track.position) AS track_count, sum(track.position)
AS track_pos_acc
FROM track
GROUP BY track.medium) s
JOIN medium ON medium.id = s.medium
WHERE first_track != 1 OR last_track != s.track_count OR
(s.track_count * (1 + s.track_count)) / 2 track_pos_acc
) m
(note: if you only get 10 rows for this query, you’re fine — they’re these ten, which are known problems)
For more safety, don’t trust anything in the track table that’s been updated since the schema change:
SELECT distinct medium FROM track WHERE last_updated > ‘2013-05-15’
If it’s possible in your application, it’s probably best to throw out any updates to tracklists since 2013-05-15.
Again, we’re sorry for the trouble this update may have caused you!
As a heads-up for anyone using postgresql 9.1 or later (9.0 is the only confirmed-correct version) anyone running a slave server, it appears that there’s an issue with the upgrade script which will result in an incorrect track table in most cases.
An ostensible fix that was previously mentioned here does not work. We’re still working on a fix and will update this post as we have more details.
There is a fix, see http://blog.musicbrainz.org/?p=1962 for instructions. Thanks for your patience!
Today we released a schema change update for MusicBrainz. Schema change updates change the format of the underlying MusicBrainz database and allow us to store more information, or model information in a richer/more correct form.
This release specifically includes some exciting new features:
A new entity is this release is the “area” entity, which can track countries, subdivisions of countries, cities, and other such location entities (venues, however, will be another entity). While this release primarily only introduces the entity, migrating only our existing list of countries, it’s now also possible to add start and end locations to artists, and to mark works as anthems. Editing of areas, their aliases and annotations, and area-area and area-url relationships, is limited to a new class of “Location Editor”.
The International Standard Name Identifier (ISNI) is an ISO standard that identifies public identities of parties. We now have support for storing ISNI codes inside the MusicBrainz database, which will make it easier to cross-reference data in MusicBrainz with other databases.
Releases can now have multiple date and country pairs, whereas previously they could only have one country and one date. This will allow us to more accurately store information about releases that occur in different areas at different dates, but are otherwise the same physical product.
We also began work on the database support for some future MusicBrainz features:
All tracks on mediums now have unique identifiers. This will allow people to refer to a specific track in a release in a way that is more resilient to editing than just the track name or position. Currently we have database support for this, but track identifiers are not yet exposed in either the website or the web service.
Dynamic work attributes will let us introduce new attributes to describe works without schema changes
This feature will let editors specify an alternative name for relationship attributes to specifically exactly which model guitar was used in a recording, rather than the current vague “electric guitar” attribute. Support for this feature is now in the database (in the link_attribute_credit) table, but the UI to do this editing is still to be finished.
Uploading cover art to the cover art archive will soon support a few other image formats, starting with PNG.
The remaining smaller schema changes are:
link_type.short_link_phrase was renamed to link_type.long_link_phrase.work.artist_credit column was dropped.If you are currently running a slave database, then you will need to perform a few manual steps to upgrade to the new version:
git fetch origin followed by git checkout v-2013-05-15carton install --deployment to install any new perl modules.carton exec -Ilib -- ./upgrade.sh from the top of the source directory.Please see the instructions in our more recent blog post instead of these instructions.
This release wouldn’t have possible without help from Alastair Porter, Michael Wiencek, Nicolás Tamargo or the rest of the MusicBrainz team – thank you all for your hard work! As we missed the previous release, there are a few other changes in this release. Here are the full release notes: