From 37e385b7aaf52ac391c6964557e30f662cb1de36 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 16 Aug 2018 13:52:07 -0400 Subject: [PATCH] 13752: Don't rewrite entire file_names column during the migration. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- doc/admin/upgrading.html.textile.liquid | 4 ---- .../api/db/migrate/20180806133039_index_all_filenames.rb | 6 ------ 2 files changed, 10 deletions(-) diff --git a/doc/admin/upgrading.html.textile.liquid b/doc/admin/upgrading.html.textile.liquid index ff7f1804c2..55f39f7d84 100644 --- a/doc/admin/upgrading.html.textile.liquid +++ b/doc/admin/upgrading.html.textile.liquid @@ -30,10 +30,6 @@ Note to developers: Add new items at the top. Include the date, issue number, co TODO: extract this information based on git commit messages and generate changelogs / release notes automatically. {% endcomment %} -h3. 2018-08-09: "21bf21abe":https://dev.arvados.org/projects/arvados/repository/revisions/21bf21abe includes a slow migration -* The migration removes the size constraint on the file_names column in the collections table, and reparses all manifests to fix any truncated values. -* Migration time depends on the size and number of collections in the database. Our test clusters processed about 20K collections per minute. - h3. 2018-07-31: "#13497":https://dev.arvados.org/issues/13497 "db5107dca":https://dev.arvados.org/projects/arvados/repository/revisions/db5107dca adds a new system service, arvados-controller * "Install the controller":../install/install-controller.html after upgrading your system. * Verify your setup by confirming that API calls appear in the controller's logs (_e.g._, @journalctl -fu arvados-controller@) while loading a workbench page. diff --git a/services/api/db/migrate/20180806133039_index_all_filenames.rb b/services/api/db/migrate/20180806133039_index_all_filenames.rb index 79259f91d8..36b155cc25 100644 --- a/services/api/db/migrate/20180806133039_index_all_filenames.rb +++ b/services/api/db/migrate/20180806133039_index_all_filenames.rb @@ -5,12 +5,6 @@ class IndexAllFilenames < ActiveRecord::Migration def up ActiveRecord::Base.connection.execute 'ALTER TABLE collections ALTER COLUMN file_names TYPE text' - Collection.find_each(batch_size: 20) do |c| - ActiveRecord::Base.connection.execute "UPDATE collections - SET file_names = #{ActiveRecord::Base.connection.quote(c.manifest_files)} - WHERE uuid = #{ActiveRecord::Base.connection.quote(c.uuid)} - AND portable_data_hash = #{ActiveRecord::Base.connection.quote(c.portable_data_hash)}" - end end def down ActiveRecord::Base.connection.execute 'ALTER TABLE collections ALTER COLUMN file_names TYPE varchar(8192)' -- 2.30.2