17090: Migration to refresh_permissions
authorPeter Amstutz <peter.amstutz@curii.com>
Thu, 5 Nov 2020 19:55:35 +0000 (14:55 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Thu, 5 Nov 2020 20:16:35 +0000 (15:16 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

services/api/db/migrate/20201105190435_refresh_permissions.rb [new file with mode: 0644]
services/api/db/structure.sql

diff --git a/services/api/db/migrate/20201105190435_refresh_permissions.rb b/services/api/db/migrate/20201105190435_refresh_permissions.rb
new file mode 100644 (file)
index 0000000..1ced9d2
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+require '20200501150153_permission_table_constants'
+
+class RefreshPermissions < ActiveRecord::Migration[5.2]
+  def change
+    # There was a report of deadlocks resulting in failing permission
+    # updates.  These failures should not have corrupted permissions
+    # (the failure should have rolled back the entire update) but we
+    # will refresh the permissions out of an abundance of caution.
+    refresh_permissions
+  end
+end
index 6f9cee270741562cb1b653bf47469521d0766f34..58c064ac3341ce953d41f83cab0425a0370e5f67 100644 (file)
@@ -3185,6 +3185,7 @@ INSERT INTO "schema_migrations" (version) VALUES
 ('20200501150153'),
 ('20200602141328'),
 ('20200914203202'),
-('20201103170213');
+('20201103170213'),
+('20201105190435');