-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1376 make ontohub org database consistent #1377
Conversation
a) Hets closes the HTTP connection after a minute, which results in timeouts. If a timeout occurs, we try again to get the provers list twice. b) Sometimes another error occurs (Hets response not usable). In both cases we print the ID of the OntologVersion to know which ones fail. This way, we can process them in another data migration.
@@ -3,7 +3,7 @@ def up | |||
obo_ontologies = Ontology.joins(:ontology_version). | |||
where(ontology_versions: {file_extension: '.obo'}) | |||
obo_ontologies.each do |ontology| | |||
ontology.sentences.find_each { |s| s.set_display_text! } | |||
ontology.sentences.select([:id, :text]).find_each(&:set_display_text!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a fancy-string: %i(id text)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with 7f10f65.
@@ -0,0 +1,14 @@ | |||
class SetBasepathWhereNil < ActiveRecord::Migration | |||
def self.up | |||
OntologyVersion.where(basepath: nil).find_each do |ov| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could optimize this query by auto-loading the ontology (includes
), and possibly by pre-selecting the fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With select
and includes
, the columns don't get updated (no matter in what order I use those two methods). So I just use includes
in 232f6a3.
Apart from my last comment: 👍 |
👍 |
…consistent 1376 make ontohub org database consistent
This shall fix #1376.
Actually, only the first commit (Set basepath where it is nil. 671a2be) restores consistency. The other ones make sure that the data migrations pass. Since failing data migrations were the main reason of the issue, I put them into this PR as well.
Note:
The data migrations should be run manually with
RAILS_ENV=production nohup rake data:migrate &
to see the IDs of the failing OntologyVersions (see the third commit's message).This way, 138 + 4350 OntologyVersions don't get a list of provers (timeout + other error).
You can find the file containing the logged failing IDs at
develop.ontohub.org:~ontohub/data_migration_provers_failures