From c66a0613968f3ba92b9b4aa38424efcc2c10e1de Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Thu, 10 Dec 2020 15:25:25 -0500 Subject: [PATCH] Use 10 workers instead of the default 100 for re-save all EPP resources (#904) * Use 10 workers instead of the default 100 for re-save all EPP resources The intended/desired effect is to have a larger number of GCS commit log diffs spread out over a longer period of time, with each diff itself being significantly smaller. This should retain roughly the same amount of total work for the async Cloud SQL replication action to have to deal with, but spread across 10X as much time. --- .../registry/batch/ResaveAllEppResourcesAction.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/main/java/google/registry/batch/ResaveAllEppResourcesAction.java b/core/src/main/java/google/registry/batch/ResaveAllEppResourcesAction.java index 75a3dfeb3..dd125f3a9 100644 --- a/core/src/main/java/google/registry/batch/ResaveAllEppResourcesAction.java +++ b/core/src/main/java/google/registry/batch/ResaveAllEppResourcesAction.java @@ -50,11 +50,21 @@ public class ResaveAllEppResourcesAction implements Runnable { @Inject Response response; @Inject ResaveAllEppResourcesAction() {} + /** + * The number of shards to run the map-only mapreduce on. + * + *

This is less than the default of 100 because we only run this action monthly and can afford + * it being slower, but we don't want to write out lots of large commit logs in a short period of + * time because they make the Cloud SQL migration tougher. + */ + private static final int NUM_SHARDS = 10; + @Override public void run() { mrRunner .setJobName("Re-save all EPP resources") .setModuleName("backend") + .setDefaultMapShards(NUM_SHARDS) .runMapOnly( new ResaveAllEppResourcesActionMapper(), ImmutableList.of(EppResourceInputs.createKeyInput(EppResource.class)))