canvas-lms/spec/initializers
Jackson Howe 3f54dcdd3e touch_all with "skip locked" lock sometimes
When updating a course's availability settings, we touch all of the
users in the course. This causes locks in production when there's
lots of users enrolled in several large courses being updated. In
the case where we are updating availability settings, we'll skip
touching user objects if the row is locked - another process will
update the timestamp.

flag = none
closes LS-3018

Test plan:
 - In a rails console, get a relation of courses doing something
   like `relation = Course.where(id: [1, 2, 3])`
 - Run `relation.touch_all_skip_locked`
 - Expect the updated_at timestamp of each course to be updated
 - Check out the SQL that was executed and expect to see
   'FOR NO KEY UPDATE SKIP LOCKED'
 - Now run `relation.touch_all`
 - Expect the timestamps to be updated again, but the SQL should
   not include 'SKIP LOCKED' lock type

Change-Id: If499982dc8fa368d312da7b8bcfc61a1f28b773b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286195
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2022-03-07 17:47:46 +00:00
..
active_record_query_trace_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
active_record_spec.rb touch_all with "skip locked" lock sometimes 2022-03-07 17:47:46 +00:00
active_support_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
canvas_http_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
class_name_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
delayed_job_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
folio_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
gems_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
i18n_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
inst_access_support_spec.rb spec: remove manual requires of spec_helper 2021-10-26 20:38:27 +00:00
jwt_workflow_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
linked_in_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
periodic_jobs_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
rack_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
rails_patches_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
ruby_version_compat_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
sentry_spec.rb Remove `sentry_disabled` kill switch setting 2022-02-14 16:19:02 +00:00
switchman_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
twitter_spec.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00