Change-Id: Ib49bc8939cf1706e758429e531a87c57d0231a37
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251156
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes FOO-685
flag = none
TEST PLAN:
1) bulk_insert a bunch of auditor records.
2) they should not get sent to the root partition.
Change-Id: Ie9f6a3af8ba2a05c77ecec89742b651f3f00f7d8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242163
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-49070
flag = none
TEST PLAN:
1) have a bunch of traffic modifying users
2) try to drop a partition from a partman table
with a FK on user
3) it does not lock up forever and cause an outage
Change-Id: I2a3e2183e69aae8ab3959d6912d7b54def31d66c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236067
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
refs CNVS-48876
flag = none
The only goal for this PS is to get the
tables and models in place to handle auditors
data being written to PG instead of cassanrda.
No actual new writing happens in this change.
create the first couple partitions as a migration
and the previous 12 to have room for backfilling
include partitions migrations for keeping indices
on individual partitions
cron-ify partitioner to keep pre-creating
new partitions for auditor tables
TEST PLAN:
* migrate the database
* do things that trigger auditor writes
- login
- change grades
- publish courses
* nothing should have changed or broken
* auditors tables should be completely empty in PG
* create the first few partitions as a migration
Change-Id: If4e2446a82fb1c91e992a28e62918ff8d8a8c73a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234064
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
will return an error if the periodic jobs
haven't been running
closes #CORE-2717
Change-Id: If192f45c0e1f32f53d26287240a717517dcb8440
Reviewed-on: https://gerrit.instructure.com/187809
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Change-Id: I8a8dd135b7da10bd2659251821cb0af0ede5726a
Reviewed-on: https://gerrit.instructure.com/178970
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
ensures the database server unshackles itself and hits the master
Change-Id: I7590b230be6a18588547442ca0a0e220b5093873
Reviewed-on: https://gerrit.instructure.com/178971
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
otherwise can break when maximum is earlier in the
week/month/etc than the minimum
Change-Id: I70513097b18e7f22d6bc43ef28d44ae57e2bef41
Reviewed-on: https://gerrit.instructure.com/174850
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
test plan:
* run the migrations
* sending messages and viewing them as an admin
should work as before
closes #COMMS-1327
Change-Id: If955b49d07fa68f8a5151984eb4d9c3b97b118ee
Reviewed-on: https://gerrit.instructure.com/170657
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
* add foreign keys to new partitions moving forward
* don't create redundant indexes on initial partitions
* remove other migrations for partitions that are long gone
test plan:
specs
Change-Id: I5cbb50593b70db5f7ba79c846fda4efb11835212
Reviewed-on: https://gerrit.instructure.com/107900
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
the thread_safe gem has deprecations too, but they'll require Rails 5.1
until they're fixed (when both activesupport and tzinfo no longer
depend on it)
Change-Id: Ic53839d911ba8ed4d463d17f9dd7207673510f3a
Reviewed-on: https://gerrit.instructure.com/100499
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
refs OPS-3846
maybe somehow the periodic job ran first, and created some
Change-Id: I3be937be3a3c9b52d62f5f2f919b368ac2ea586e
Reviewed-on: https://gerrit.instructure.com/82702
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
closes CNVS-29133
test plan:
* run the migrations
* inspect your database; there should be versions_0, versions_1,
versions_2 tables.
* drop versions_2 manually
* run Versions::Partitioner.process
* versions_2 should be created again, and have the proper indexes
* use pieces of canvas that rely on versions; nothing should be broken
Change-Id: I3211fdd3fd1716b8a7e6c6f7553a6e49cc6e39bb
Reviewed-on: https://gerrit.instructure.com/80214
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
* for PartitionManager, don't have your own migrations paths, just
use ActiveRecord's
* vendor/plugins is long gone; don't look for migrations there
anymore
Change-Id: Ia4e2c91e59beb2d723cbdc5072b26cddd70638c9
Reviewed-on: https://gerrit.instructure.com/53267
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
* move most of the logic into PartitionManager
* use a setting for how many partitions to precreate/prune
* enumerate existing tables for pruning, instead of assuming
we can just roll off the last one
* actually run the tests for partman from CI
* simplify configuring partitioned migrations (just rely
on the model to get the table name, instead of trying to
guess the model from the table name, and sometimes having
to provide both)
Change-Id: Ic8ac2b603a02f092b2f278d2b366b1cd9f942954
Reviewed-on: https://gerrit.instructure.com/53286
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Brian Finney <bfinney@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fixes CNVS-17723
test plan:
- as a teacher
- create a OQAAT quiz with a few questions
- publish the quiz
- as a student
- take the quiz
- you should not get errors when answering questions
Change-Id: I5811e775112bd030d1ea3703985c7f3b194d4901
Reviewed-on: https://gerrit.instructure.com/46458
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Ahmad Amireh <ahmad@instructure.com>
Closes CNVS-16878
TEST PLAN
---- ----
Similar to g/44145 but no rake tasks needed.
- check out the patch
- run `bundle exec rake db:migrate`
- run the rails server and visit any page:
+ if you got this far, and jenkins has passed, things are good
Change-Id: Icfed777974269c344b5e1e1c2617ab2f3836f38f
Reviewed-on: https://gerrit.instructure.com/44405
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
A small gem for abstracting partitioning at the model layer, as well as
helpers for dynamically creating the partitions needed for quiz
submission events.
You can read more about the gem's API in its README file.
Closes CNVS-16795
TEST PLAN
---- ----
- check out the patch
- run `bundle exec rake db:migrate`
- run `bundle exec rake canvas:quizzes:create_event_partitions`
- run the rails server and visit any page:
+ if you got this far, and jenkins has passed, things are good
Change-Id: I7d6b77c62db8510e09a54fbae00048a14b5366bb
Reviewed-on: https://gerrit.instructure.com/44145
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>