strand auditors by jobs db

refs CNVS-48876
flag = none

TEST PLAN:
 1) backfill auditors
 2) parallelism should be controlable
    globally by auditor type with one setting.

Change-Id: I5d5d90aa25e2f4a8f2cd1a8efa90893d517be41e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237359
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>
This commit is contained in:
Ethan Vizitei 2020-05-14 11:21:32 -05:00
parent 848a4b36c3
commit ece230a8cc
2 changed files with 5 additions and 6 deletions

View File

@ -442,7 +442,7 @@ module DataFixup::Auditors
end
def parallelism_key(auditor_type)
"auditors_migration_#{auditor_type}/#{cluster_name}_num_strands"
"auditors_migration_#{auditor_type}_num_strands"
end
def check_parallelism
@ -631,13 +631,13 @@ module DataFixup::Auditors
# auth records are stored at the root account level,
# we only need to enqueue these jobs for root accounts
auth_worker = AuthenticationWorker.new(account.id, current_date)
conditionally_enqueue_worker(auth_worker, ["auditors_migration_authentications", cluster_name])
conditionally_enqueue_worker(auth_worker, "auditors_migration_authentications")
end
course_worker = CourseWorker.new(account.id, current_date)
conditionally_enqueue_worker(course_worker, ["auditors_migration_courses", cluster_name])
conditionally_enqueue_worker(course_worker, "auditors_migration_courses")
grade_change_worker = GradeChangeWorker.new(account.id, current_date)
conditionally_enqueue_worker(grade_change_worker, ["auditors_migration_grade_changes", cluster_name])
conditionally_enqueue_worker(grade_change_worker, "auditors_migration_grade_changes")
end
def enqueue_one_day(current_date)

View File

@ -279,8 +279,7 @@ module DataFixup::Auditors::Migrate
it "buckets settings by JOB cluster" do
pk = BackfillEngine.parallelism_key("grade_changes")
# because default shard has a nil job id
expect(pk).to eq("auditors_migration_grade_changes/#{Shard.current.database_server.id}_num_strands")
expect(pk).to eq("auditors_migration_grade_changes_num_strands")
end
it "wont enqueue complete jobs" do