Re: [galaxy-dev] Galaxy updated botched?
This is a follow up for those that are interested with regards to my failed schema upgrade. I believe I have determined why all the tables are set to use the MyISAM engine. When I initialized galaxy on our enterprise servers, they were running a dated version of CentOS. Hence, the OS defaults to a dated MySQL version. MySQL only switched to using InnoDB (over MyISAM) as the default engine in version 5.5. If I'm not mistaken, I initialized galaxy in MySQL 5.1 without changing the default engine to InnoDB (big mistake). Due to my ignorance, I will now have to try to compare v118 of our database with a new install of galaxy running schema v118. Then, I will try "migrating" to the true schema state without destroying the data. I do feel that I should still modify the galaxy schema to set the MySQL engine to InnoDB to thwart problems like this for other unsuspecting users. If anyone can point me at some documentation about how Galaxy schema changes should occur in this case, that would be great. As per my previous comment, I'm not certain whether I would edit all schema versions to ensure table definitions include the mysql_engine=InnoDB attribute or whether using a DDL event in SQLAlchemy. I suspect that setting this option globally would mean that future developers don't need to remember to define mysql_engine on every new table. Iyad Kandalaft Microbial Biodiversity Bioinformatics Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada 960 Carling Ave.| 960 Ave. Carling Ottawa, ON| Ottawa (ON) K1A 0C6 E-mail Address / Adresse courriel Iyad.Kandalaft@agr.gc.ca Telephone | Téléphone 613-759-1228 Facsimile | Télécopieur 613-759-1701 Teletypewriter | Téléimprimeur 613-773-2600 Government of Canada | Gouvernement du Canada From: Kandalaft, Iyad Sent: Tuesday, June 10, 2014 1:39 PM To: 'galaxy-dev@bx.psu.edu' Subject: Re: Galaxy updated botched? Hi Everyone, This is follow-up information/questions to the issue I ran into with the galaxy June 2nd, 2014 update. I hope to receive feedback on how to proceed. Background: - Running Galaxy (DB Schema 118) with a MySQL 5.5 back-end - When updating galaxy to the june 2nd release, the v120 DB schema has referential integrity constraints, which produced errors during the upgrade. - Completed two galaxy updates in the past 4 months without encountering this before (schema changes included) Discussion: In the past, referential integrity in the DB schema was never an issue. I checked backups and the current database to find that the database tables are using the MyISAM engine. MyISAM = no referential integrity support, no transactions. I reviewed galaxy's SQLAlchemy templates and determined that mysql_engine='InnoDB' isn't set on tables. This explains why all tables were created with the MyISAM engine. If the mysql_engine is not innodb, SQL Alchemy is supposed to drop any referential integrity constraints defined in the schema. What I don't understand is why SQL Alchemy is no longer ignoring the referential integrity constraints. Going forward, can anyone propose how I can salvage the database or continue ignoring referential integrity for now? Assuming that my limited understanding of SQLAlchemy holds water, I was looking at fixing the galaxy code base but I need some clarification on the DB schema versioning. Do I edit schema v1 and add the appropriate table args to make every table an innodb engine table or do I add a new schema and modify all tables to use the innodb engine? Alternatively, I can use DDL events def after_create(target, connection, **kw): connection.execute("ALTER TABLE %s ENGINE=InnoDB; (target.name, target.name)) Thank you for your help. Regards, Iyad Kandalaft Bioinformatics Application Developer Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada KW Neatby Bldg | éd. KW Neatby 960 Carling Ave| 960, avenue Carling Ottawa, ON | Ottawa (ON) K1A 0C6 E-mail Address / Adresse courriel: Iyad.Kandalaft@agr.gc.ca<mailto:Iyad.Kandalaft@agr.gc.ca> Telephone | Téléphone 613- 759-1228 Facsimile | Télécopieur 613-759-1701 Government of Canada | Gouvernement du Canada
Spent a couple hours yesterday trying to track down this - I was not getting anywhere though and I see why now. Well this definitely an unfortunate situation - but I think documentation improvements are the right fix not enforcing the engine type in sqlalchemy migrations. For one, I don't think we can assume a particular engine type because different deployers may already going to have both kinds out there right? I think it would be better to update the wiki to encourage InnoDB for all new installations and warn this can happen for MySQL upgrades. Is this okay? Sorry about this. -John On Wed, Jun 11, 2014 at 8:48 AM, Kandalaft, Iyad <Iyad.Kandalaft@agr.gc.ca> wrote:
This is a follow up for those that are interested with regards to my failed schema upgrade.
I believe I have determined why all the tables are set to use the MyISAM engine. When I initialized galaxy on our enterprise servers, they were running a dated version of CentOS. Hence, the OS defaults to a dated MySQL version. MySQL only switched to using InnoDB (over MyISAM) as the default engine in version 5.5. If I’m not mistaken, I initialized galaxy in MySQL 5.1 without changing the default engine to InnoDB (big mistake). Due to my ignorance, I will now have to try to compare v118 of our database with a new install of galaxy running schema v118. Then, I will try “migrating” to the true schema state without destroying the data.
I do feel that I should still modify the galaxy schema to set the MySQL engine to InnoDB to thwart problems like this for other unsuspecting users. If anyone can point me at some documentation about how Galaxy schema changes should occur in this case, that would be great.
As per my previous comment, I’m not certain whether I would edit all schema versions to ensure table definitions include the mysql_engine=InnoDB attribute or whether using a DDL event in SQLAlchemy. I suspect that setting this option globally would mean that future developers don’t need to remember to define mysql_engine on every new table.
Iyad Kandalaft
Microbial Biodiversity Bioinformatics
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada 960 Carling Ave.| 960 Ave. Carling
Ottawa, ON| Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel Iyad.Kandalaft@agr.gc.ca Telephone | Téléphone 613-759-1228 Facsimile | Télécopieur 613-759-1701 Teletypewriter | Téléimprimeur 613-773-2600
Government of Canada | Gouvernement du Canada
From: Kandalaft, Iyad Sent: Tuesday, June 10, 2014 1:39 PM To: 'galaxy-dev@bx.psu.edu' Subject: Re: Galaxy updated botched?
Hi Everyone,
This is follow-up information/questions to the issue I ran into with the galaxy June 2nd, 2014 update. I hope to receive feedback on how to proceed.
Background:
- Running Galaxy (DB Schema 118) with a MySQL 5.5 back-end
- When updating galaxy to the june 2nd release, the v120 DB schema has referential integrity constraints, which produced errors during the upgrade.
- Completed two galaxy updates in the past 4 months without encountering this before (schema changes included)
Discussion:
In the past, referential integrity in the DB schema was never an issue. I checked backups and the current database to find that the database tables are using the MyISAM engine. MyISAM = no referential integrity support, no transactions.
I reviewed galaxy’s SQLAlchemy templates and determined that mysql_engine='InnoDB' isn’t set on tables. This explains why all tables were created with the MyISAM engine. If the mysql_engine is not innodb, SQL Alchemy is supposed to drop any referential integrity constraints defined in the schema. What I don’t understand is why SQL Alchemy is no longer ignoring the referential integrity constraints.
Going forward, can anyone propose how I can salvage the database or continue ignoring referential integrity for now?
Assuming that my limited understanding of SQLAlchemy holds water, I was looking at fixing the galaxy code base but I need some clarification on the DB schema versioning. Do I edit schema v1 and add the appropriate table args to make every table an innodb engine table or do I add a new schema and modify all tables to use the innodb engine? Alternatively, I can use DDL events
def after_create(target, connection, **kw):
connection.execute("ALTER TABLE %s ENGINE=InnoDB;
(target.name, target.name))
Thank you for your help.
Regards,
Iyad Kandalaft
Bioinformatics Application Developer
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada
KW Neatby Bldg | éd. KW Neatby
960 Carling Ave| 960, avenue Carling
Ottawa, ON | Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel: Iyad.Kandalaft@agr.gc.ca
Telephone | Téléphone 613- 759-1228
Facsimile | Télécopieur 613-759-1701
Government of Canada | Gouvernement du Canada
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
Hey Iyad, I just want to second (and add slightly) to what John said here. I had also failed to reproduce this locally, but that makes perfect sense now -- I'm glad you figured it out, and thanks for looking into this so closely and reporting back. Like John said, I wouldn't modify the migrations to force or assume a particular engine, but if you wanted to make a contribution to the code base it would probably be worth improving the detection and reporting of this particular error condition to help anyone else who might run into the issue -- if you wanted to take a stab at that. On Wed, Jun 11, 2014 at 10:08 AM, John Chilton <jmchilton@gmail.com> wrote:
Spent a couple hours yesterday trying to track down this - I was not getting anywhere though and I see why now.
Well this definitely an unfortunate situation - but I think documentation improvements are the right fix not enforcing the engine type in sqlalchemy migrations. For one, I don't think we can assume a particular engine type because different deployers may already going to have both kinds out there right?
I think it would be better to update the wiki to encourage InnoDB for all new installations and warn this can happen for MySQL upgrades.
Is this okay?
Sorry about this.
-John
This is a follow up for those that are interested with regards to my failed schema upgrade.
I believe I have determined why all the tables are set to use the MyISAM engine. When I initialized galaxy on our enterprise servers, they were running a dated version of CentOS. Hence, the OS defaults to a dated MySQL version. MySQL only switched to using InnoDB (over MyISAM) as the default engine in version 5.5. If I’m not mistaken, I initialized galaxy in MySQL 5.1 without changing the default engine to InnoDB (big mistake). Due to my ignorance, I will now have to try to compare v118 of our database with a new install of galaxy running schema v118. Then, I will try “migrating” to
true schema state without destroying the data.
I do feel that I should still modify the galaxy schema to set the MySQL engine to InnoDB to thwart problems like this for other unsuspecting users. If anyone can point me at some documentation about how Galaxy schema changes should occur in this case, that would be great.
As per my previous comment, I’m not certain whether I would edit all schema versions to ensure table definitions include the mysql_engine=InnoDB attribute or whether using a DDL event in SQLAlchemy. I suspect that setting this option globally would mean that future developers don’t need to remember to define mysql_engine on every new table.
Iyad Kandalaft
Microbial Biodiversity Bioinformatics
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada 960 Carling Ave.| 960 Ave. Carling
Ottawa, ON| Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel Iyad.Kandalaft@agr.gc.ca Telephone | Téléphone 613-759-1228 Facsimile | Télécopieur 613-759-1701 Teletypewriter | Téléimprimeur 613-773-2600
Government of Canada | Gouvernement du Canada
From: Kandalaft, Iyad Sent: Tuesday, June 10, 2014 1:39 PM To: 'galaxy-dev@bx.psu.edu' Subject: Re: Galaxy updated botched?
Hi Everyone,
This is follow-up information/questions to the issue I ran into with the galaxy June 2nd, 2014 update. I hope to receive feedback on how to
On Wed, Jun 11, 2014 at 8:48 AM, Kandalaft, Iyad <Iyad.Kandalaft@agr.gc.ca> wrote: the proceed.
Background:
- Running Galaxy (DB Schema 118) with a MySQL 5.5 back-end
- When updating galaxy to the june 2nd release, the v120 DB
has referential integrity constraints, which produced errors during the upgrade.
- Completed two galaxy updates in the past 4 months without encountering this before (schema changes included)
Discussion:
In the past, referential integrity in the DB schema was never an issue. I checked backups and the current database to find that the database tables are using the MyISAM engine. MyISAM = no referential integrity support, no transactions.
I reviewed galaxy’s SQLAlchemy templates and determined that mysql_engine='InnoDB' isn’t set on tables. This explains why all tables were created with the MyISAM engine. If the mysql_engine is not innodb, SQL Alchemy is supposed to drop any referential integrity constraints defined in the schema. What I don’t understand is why SQL Alchemy is no longer ignoring the referential integrity constraints.
Going forward, can anyone propose how I can salvage the database or continue ignoring referential integrity for now?
Assuming that my limited understanding of SQLAlchemy holds water, I was looking at fixing the galaxy code base but I need some clarification on
schema the
DB schema versioning. Do I edit schema v1 and add the appropriate table args to make every table an innodb engine table or do I add a new schema and modify all tables to use the innodb engine? Alternatively, I can use DDL events
def after_create(target, connection, **kw):
connection.execute("ALTER TABLE %s ENGINE=InnoDB;
(target.name, target.name))
Thank you for your help.
Regards,
Iyad Kandalaft
Bioinformatics Application Developer
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada
KW Neatby Bldg | éd. KW Neatby
960 Carling Ave| 960, avenue Carling
Ottawa, ON | Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel: Iyad.Kandalaft@agr.gc.ca
Telephone | Téléphone 613- 759-1228
Facsimile | Télécopieur 613-759-1701
Government of Canada | Gouvernement du Canada
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
Dannon & John, Thank you for your feedback. I agree that documentation is a good start. I’m still in the process of figuring out what actually happens to the database schema. It may be completely fine with no referential integrity constraints, which I’m okay with to some degree (we’re still in the infancy stages with Galaxy). I find it odd that these referential integrity errors popped up “all of a sudden” because I don’t recall noticing these errors when I first installed galaxy/initialized the database. I did move the database to the new version of MySQL, where InnoDB is the default and referencing primary keys on a MyISAM table caused the problem. As a side note, I would be interested to know your reasons for avoiding a hardcoded mysql engine. If galaxy depends on referential integrity (not that I am assuming it does), then setting the MySQL engine to Memory or MyISAM would be disastrous. Also, do you see any distinct advantages to using MyISAM for galaxy? Regards, Iyad Kandalaft Microbial Biodiversity Bioinformatics Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada 960 Carling Ave.| 960 Ave. Carling Ottawa, ON| Ottawa (ON) K1A 0C6 E-mail Address / Adresse courriel Iyad.Kandalaft@agr.gc.ca Telephone | Téléphone 613-759-1228 Facsimile | Télécopieur 613-759-1701 Teletypewriter | Téléimprimeur 613-773-2600 Government of Canada | Gouvernement du Canada From: Dannon Baker [mailto:dannon.baker@gmail.com] Sent: Wednesday, June 11, 2014 10:23 AM To: John Chilton Cc: Kandalaft, Iyad; galaxy-dev@bx.psu.edu Subject: Re: [galaxy-dev] Galaxy updated botched? Hey Iyad, I just want to second (and add slightly) to what John said here. I had also failed to reproduce this locally, but that makes perfect sense now -- I'm glad you figured it out, and thanks for looking into this so closely and reporting back. Like John said, I wouldn't modify the migrations to force or assume a particular engine, but if you wanted to make a contribution to the code base it would probably be worth improving the detection and reporting of this particular error condition to help anyone else who might run into the issue -- if you wanted to take a stab at that. On Wed, Jun 11, 2014 at 10:08 AM, John Chilton <jmchilton@gmail.com<mailto:jmchilton@gmail.com>> wrote: Spent a couple hours yesterday trying to track down this - I was not getting anywhere though and I see why now. Well this definitely an unfortunate situation - but I think documentation improvements are the right fix not enforcing the engine type in sqlalchemy migrations. For one, I don't think we can assume a particular engine type because different deployers may already going to have both kinds out there right? I think it would be better to update the wiki to encourage InnoDB for all new installations and warn this can happen for MySQL upgrades. Is this okay? Sorry about this. -John On Wed, Jun 11, 2014 at 8:48 AM, Kandalaft, Iyad <Iyad.Kandalaft@agr.gc.ca<mailto:Iyad.Kandalaft@agr.gc.ca>> wrote:
This is a follow up for those that are interested with regards to my failed schema upgrade.
I believe I have determined why all the tables are set to use the MyISAM engine. When I initialized galaxy on our enterprise servers, they were running a dated version of CentOS. Hence, the OS defaults to a dated MySQL version. MySQL only switched to using InnoDB (over MyISAM) as the default engine in version 5.5. If I’m not mistaken, I initialized galaxy in MySQL 5.1 without changing the default engine to InnoDB (big mistake). Due to my ignorance, I will now have to try to compare v118 of our database with a new install of galaxy running schema v118. Then, I will try “migrating” to the true schema state without destroying the data.
I do feel that I should still modify the galaxy schema to set the MySQL engine to InnoDB to thwart problems like this for other unsuspecting users. If anyone can point me at some documentation about how Galaxy schema changes should occur in this case, that would be great.
As per my previous comment, I’m not certain whether I would edit all schema versions to ensure table definitions include the mysql_engine=InnoDB attribute or whether using a DDL event in SQLAlchemy. I suspect that setting this option globally would mean that future developers don’t need to remember to define mysql_engine on every new table.
Iyad Kandalaft
Microbial Biodiversity Bioinformatics
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada 960 Carling Ave.| 960 Ave. Carling
Ottawa, ON| Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel Iyad.Kandalaft@agr.gc.ca<mailto:Iyad.Kandalaft@agr.gc.ca> Telephone | Téléphone 613-759-1228<tel:613-759-1228> Facsimile | Télécopieur 613-759-1701<tel:613-759-1701> Teletypewriter | Téléimprimeur 613-773-2600<tel:613-773-2600>
Government of Canada | Gouvernement du Canada
From: Kandalaft, Iyad Sent: Tuesday, June 10, 2014 1:39 PM To: 'galaxy-dev@bx.psu.edu<mailto:galaxy-dev@bx.psu.edu>' Subject: Re: Galaxy updated botched?
Hi Everyone,
This is follow-up information/questions to the issue I ran into with the galaxy June 2nd, 2014 update. I hope to receive feedback on how to proceed.
Background:
- Running Galaxy (DB Schema 118) with a MySQL 5.5 back-end
- When updating galaxy to the june 2nd release, the v120 DB schema has referential integrity constraints, which produced errors during the upgrade.
- Completed two galaxy updates in the past 4 months without encountering this before (schema changes included)
Discussion:
In the past, referential integrity in the DB schema was never an issue. I checked backups and the current database to find that the database tables are using the MyISAM engine. MyISAM = no referential integrity support, no transactions.
I reviewed galaxy’s SQLAlchemy templates and determined that mysql_engine='InnoDB' isn’t set on tables. This explains why all tables were created with the MyISAM engine. If the mysql_engine is not innodb, SQL Alchemy is supposed to drop any referential integrity constraints defined in the schema. What I don’t understand is why SQL Alchemy is no longer ignoring the referential integrity constraints.
Going forward, can anyone propose how I can salvage the database or continue ignoring referential integrity for now?
Assuming that my limited understanding of SQLAlchemy holds water, I was looking at fixing the galaxy code base but I need some clarification on the DB schema versioning. Do I edit schema v1 and add the appropriate table args to make every table an innodb engine table or do I add a new schema and modify all tables to use the innodb engine? Alternatively, I can use DDL events
def after_create(target, connection, **kw):
connection.execute("ALTER TABLE %s ENGINE=InnoDB;
(target.name<http://target.name>, target.name<http://target.name>))
Thank you for your help.
Regards,
Iyad Kandalaft
Bioinformatics Application Developer
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada
KW Neatby Bldg | éd. KW Neatby
960 Carling Ave| 960, avenue Carling
Ottawa, ON | Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel: Iyad.Kandalaft@agr.gc.ca<mailto:Iyad.Kandalaft@agr.gc.ca>
Telephone | Téléphone 613- 759-1228<tel:613-%20759-1228>
Facsimile | Télécopieur 613-759-1701<tel:613-759-1701>
Government of Canada | Gouvernement du Canada
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/ To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
On Wed, Jun 11, 2014 at 3:26 PM, Kandalaft, Iyad <Iyad.Kandalaft@agr.gc.ca> wrote:
Dannon & John,
Thank you for your feedback. I agree that documentation is a good start.
I’m still in the process of figuring out what actually happens to the database schema. It may be completely fine with no referential integrity constraints, which I’m okay with to some degree (we’re still in the infancy stages with Galaxy). I find it odd that these referential integrity errors popped up “all of a sudden” because I don’t recall noticing these errors when I first installed galaxy/initialized the database. I did move the database to the new version of MySQL, where InnoDB is the default and referencing primary keys on a MyISAM table caused the problem.
As a side note, I would be interested to know your reasons for avoiding a hardcoded mysql engine. If galaxy depends on referential integrity (not that I am assuming it does), then setting the MySQL engine to Memory or MyISAM would be disastrous. Also, do you see any distinct advantages to using MyISAM for galaxy?
Well there have never been any reports of anyone having problems with MyISAM in particular - its the switch here that seems to be the problem as far as I can tell. If I had to venture a guess as to why no one has complained about non-InnoDB engines - I would say the referential integrity constraints are never violated by the statements that the ORM generates - so they are a nice to have backup primary protection - but are not strictly required. Certainly, if one has to use MySQL and has a choice I would recommend InnoDB for most interesting applications and Galaxy in particular, but *IF* we forced it we would break existing Galaxy installations using MyISAM right? If one did not have to worry about breaking Galaxy installations - I think a majority of the devteam would like drop support for MySQL entirely (and I think our recommendation of Postgres is unanimous). If anyone out there has tired using Galaxy with strictly MyISAM tables and found it untenable - by all means please chime in. -John
Regards,
Iyad Kandalaft
Microbial Biodiversity Bioinformatics
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada 960 Carling Ave.| 960 Ave. Carling
Ottawa, ON| Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel Iyad.Kandalaft@agr.gc.ca Telephone | Téléphone 613-759-1228 Facsimile | Télécopieur 613-759-1701 Teletypewriter | Téléimprimeur 613-773-2600 Government of Canada | Gouvernement du Canada
From: Dannon Baker [mailto:dannon.baker@gmail.com] Sent: Wednesday, June 11, 2014 10:23 AM To: John Chilton Cc: Kandalaft, Iyad; galaxy-dev@bx.psu.edu Subject: Re: [galaxy-dev] Galaxy updated botched?
Hey Iyad,
I just want to second (and add slightly) to what John said here. I had also failed to reproduce this locally, but that makes perfect sense now -- I'm glad you figured it out, and thanks for looking into this so closely and reporting back.
Like John said, I wouldn't modify the migrations to force or assume a particular engine, but if you wanted to make a contribution to the code base it would probably be worth improving the detection and reporting of this particular error condition to help anyone else who might run into the issue -- if you wanted to take a stab at that.
On Wed, Jun 11, 2014 at 10:08 AM, John Chilton <jmchilton@gmail.com> wrote:
Spent a couple hours yesterday trying to track down this - I was not getting anywhere though and I see why now.
Well this definitely an unfortunate situation - but I think documentation improvements are the right fix not enforcing the engine type in sqlalchemy migrations. For one, I don't think we can assume a particular engine type because different deployers may already going to have both kinds out there right?
I think it would be better to update the wiki to encourage InnoDB for all new installations and warn this can happen for MySQL upgrades.
Is this okay?
Sorry about this.
-John
On Wed, Jun 11, 2014 at 8:48 AM, Kandalaft, Iyad <Iyad.Kandalaft@agr.gc.ca> wrote:
This is a follow up for those that are interested with regards to my failed schema upgrade.
I believe I have determined why all the tables are set to use the MyISAM engine. When I initialized galaxy on our enterprise servers, they were running a dated version of CentOS. Hence, the OS defaults to a dated MySQL version. MySQL only switched to using InnoDB (over MyISAM) as the default engine in version 5.5. If I’m not mistaken, I initialized galaxy in MySQL 5.1 without changing the default engine to InnoDB (big mistake). Due to my ignorance, I will now have to try to compare v118 of our database with a new install of galaxy running schema v118. Then, I will try “migrating” to the true schema state without destroying the data.
I do feel that I should still modify the galaxy schema to set the MySQL engine to InnoDB to thwart problems like this for other unsuspecting users. If anyone can point me at some documentation about how Galaxy schema changes should occur in this case, that would be great.
As per my previous comment, I’m not certain whether I would edit all schema versions to ensure table definitions include the mysql_engine=InnoDB attribute or whether using a DDL event in SQLAlchemy. I suspect that setting this option globally would mean that future developers don’t need to remember to define mysql_engine on every new table.
Iyad Kandalaft
Microbial Biodiversity Bioinformatics
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada 960 Carling Ave.| 960 Ave. Carling
Ottawa, ON| Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel Iyad.Kandalaft@agr.gc.ca Telephone | Téléphone 613-759-1228 Facsimile | Télécopieur 613-759-1701 Teletypewriter | Téléimprimeur 613-773-2600
Government of Canada | Gouvernement du Canada
From: Kandalaft, Iyad Sent: Tuesday, June 10, 2014 1:39 PM To: 'galaxy-dev@bx.psu.edu' Subject: Re: Galaxy updated botched?
Hi Everyone,
This is follow-up information/questions to the issue I ran into with the galaxy June 2nd, 2014 update. I hope to receive feedback on how to proceed.
Background:
- Running Galaxy (DB Schema 118) with a MySQL 5.5 back-end
- When updating galaxy to the june 2nd release, the v120 DB schema has referential integrity constraints, which produced errors during the upgrade.
- Completed two galaxy updates in the past 4 months without encountering this before (schema changes included)
Discussion:
In the past, referential integrity in the DB schema was never an issue. I checked backups and the current database to find that the database tables are using the MyISAM engine. MyISAM = no referential integrity support, no transactions.
I reviewed galaxy’s SQLAlchemy templates and determined that mysql_engine='InnoDB' isn’t set on tables. This explains why all tables were created with the MyISAM engine. If the mysql_engine is not innodb, SQL Alchemy is supposed to drop any referential integrity constraints defined in the schema. What I don’t understand is why SQL Alchemy is no longer ignoring the referential integrity constraints.
Going forward, can anyone propose how I can salvage the database or continue ignoring referential integrity for now?
Assuming that my limited understanding of SQLAlchemy holds water, I was looking at fixing the galaxy code base but I need some clarification on the DB schema versioning. Do I edit schema v1 and add the appropriate table args to make every table an innodb engine table or do I add a new schema and modify all tables to use the innodb engine? Alternatively, I can use DDL events
def after_create(target, connection, **kw):
connection.execute("ALTER TABLE %s ENGINE=InnoDB;
(target.name, target.name))
Thank you for your help.
Regards,
Iyad Kandalaft
Bioinformatics Application Developer
Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada
KW Neatby Bldg | éd. KW Neatby
960 Carling Ave| 960, avenue Carling
Ottawa, ON | Ottawa (ON) K1A 0C6
E-mail Address / Adresse courriel: Iyad.Kandalaft@agr.gc.ca
Telephone | Téléphone 613- 759-1228
Facsimile | Télécopieur 613-759-1701
Government of Canada | Gouvernement du Canada
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
On 06/12/2014 12:06 AM, John Chilton wrote:
If anyone out there has tired using Galaxy with strictly MyISAM tables and found it untenable - by all means please chime in.
Well, due to several reasons we are (still) using MySQL (version: 5.1.69) with only MyISAM tables. We have been running into troubles but they were never related to running MyISAM. However, I haven't done the latest Galaxy code upgrade, hence we are still on database version '118'. So, I am curious to see what will happen when I do the next upgrade (after GCC). Also, on my list of things to do for this year is actually changing all our Galaxy servers from MySQL to PostgreSQL. With my current workload, I doubt I will manage to do this and have to postpone this 'adventure' to next year. Regards, Hans-Rudolf
Hey Hans (and anyone else using MySQL), Just to clarify -- MySQL doesn't have this (particular) error by default and as long as your server default table type has not and does not change you should be fine. I've just successfully tested MySQL using MyISAM all the way to the current tip revision and you should be able to upgrade safely when the time comes. -Dannon On Thu, Jun 12, 2014 at 2:01 AM, Hans-Rudolf Hotz <hrh@fmi.ch> wrote:
On 06/12/2014 12:06 AM, John Chilton wrote:
If anyone out there has tired using Galaxy with strictly MyISAM tables and found it untenable - by all means please chime in.
Well, due to several reasons we are (still) using MySQL (version: 5.1.69) with only MyISAM tables. We have been running into troubles but they were never related to running MyISAM.
However, I haven't done the latest Galaxy code upgrade, hence we are still on database version '118'. So, I am curious to see what will happen when I do the next upgrade (after GCC).
Also, on my list of things to do for this year is actually changing all our Galaxy servers from MySQL to PostgreSQL. With my current workload, I doubt I will manage to do this and have to postpone this 'adventure' to next year.
Regards, Hans-Rudolf
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
Thanks to everyone for their input. John, your explanation was excellent. I completely agree with the implementation of galaxy as it stands now (with a minor documentation warning about default mysql engine switch in v5.5). Personally, I either place trust in the ORM to maintain referential integrity or I offload it to the DB Engine. Hence, I will keep the MyISAM tables going for now after I do some validation against an InnoDB database (please no MyISAM engine hate-mail LOL). With respect to dropping MySQL support, I will let that one go by for now LOL. Thanks again for your contributions and maintenance of this great platform. I feel that it will be a game changer in the bioinformatics community. Regards, Iyad Kandalaft Microbial Biodiversity Bioinformatics Agriculture and Agri-Food Canada | Agriculture et Agroalimentaire Canada 960 Carling Ave.| 960 Ave. Carling Ottawa, ON| Ottawa (ON) K1A 0C6 E-mail Address / Adresse courriel Iyad.Kandalaft@agr.gc.ca Telephone | Téléphone 613-759-1228 Facsimile | Télécopieur 613-759-1701 Teletypewriter | Téléimprimeur 613-773-2600 Government of Canada | Gouvernement du Canada From: Dannon Baker [mailto:dannon.baker@gmail.com] Sent: Thursday, June 12, 2014 9:16 AM To: Hans-Rudolf Hotz Cc: John Chilton; Kandalaft, Iyad; galaxy-dev@bx.psu.edu Subject: Re: [galaxy-dev] Galaxy updated botched? Hey Hans (and anyone else using MySQL), Just to clarify -- MySQL doesn't have this (particular) error by default and as long as your server default table type has not and does not change you should be fine. I've just successfully tested MySQL using MyISAM all the way to the current tip revision and you should be able to upgrade safely when the time comes. -Dannon On Thu, Jun 12, 2014 at 2:01 AM, Hans-Rudolf Hotz <hrh@fmi.ch<mailto:hrh@fmi.ch>> wrote: On 06/12/2014 12:06 AM, John Chilton wrote: If anyone out there has tired using Galaxy with strictly MyISAM tables and found it untenable - by all means please chime in. Well, due to several reasons we are (still) using MySQL (version: 5.1.69) with only MyISAM tables. We have been running into troubles but they were never related to running MyISAM. However, I haven't done the latest Galaxy code upgrade, hence we are still on database version '118'. So, I am curious to see what will happen when I do the next upgrade (after GCC). Also, on my list of things to do for this year is actually changing all our Galaxy servers from MySQL to PostgreSQL. With my current workload, I doubt I will manage to do this and have to postpone this 'adventure' to next year. Regards, Hans-Rudolf ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/ To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/
participants (4)
-
Dannon Baker
-
Hans-Rudolf Hotz
-
John Chilton
-
Kandalaft, Iyad