diff --git a/core/src/main/java/google/registry/reporting/billing/GenerateInvoicesAction.java b/core/src/main/java/google/registry/reporting/billing/GenerateInvoicesAction.java index a180e9d32..1219b2e1a 100644 --- a/core/src/main/java/google/registry/reporting/billing/GenerateInvoicesAction.java +++ b/core/src/main/java/google/registry/reporting/billing/GenerateInvoicesAction.java @@ -32,6 +32,7 @@ import com.google.common.net.MediaType; import google.registry.config.RegistryConfig.Config; import google.registry.config.RegistryEnvironment; import google.registry.model.common.DatabaseMigrationStateSchedule.PrimaryDatabase; +import google.registry.persistence.PersistenceModule; import google.registry.reporting.ReportingModule; import google.registry.request.Action; import google.registry.request.Parameter; @@ -120,17 +121,16 @@ public class GenerateInvoicesAction implements Runnable { .setContainerSpecGcsPath( String.format("%s/%s_metadata.json", stagingBucketUrl, PIPELINE_NAME)) .setParameters( - ImmutableMap.of( - "yearMonth", - yearMonth.toString("yyyy-MM"), - "invoiceFilePrefix", - invoiceFilePrefix, - "database", - database.name(), - "billingBucketUrl", - billingBucketUrl, - "registryEnvironment", - RegistryEnvironment.get().name())); + new ImmutableMap.Builder() + .put("yearMonth", yearMonth.toString("yyyy-MM")) + .put("invoiceFilePrefix", invoiceFilePrefix) + .put("database", database.name()) + .put("billingBucketUrl", billingBucketUrl) + .put("registryEnvironment", RegistryEnvironment.get().name()) + .put( + "jpaTransactionManagerType", + PersistenceModule.JpaTransactionManagerType.READ_ONLY_REPLICA.toString()) + .build()); LaunchFlexTemplateResponse launchResponse = dataflow .projects() diff --git a/core/src/main/resources/google/registry/beam/invoicing_pipeline_metadata.json b/core/src/main/resources/google/registry/beam/invoicing_pipeline_metadata.json index ecab86358..28d1ce822 100644 --- a/core/src/main/resources/google/registry/beam/invoicing_pipeline_metadata.json +++ b/core/src/main/resources/google/registry/beam/invoicing_pipeline_metadata.json @@ -69,6 +69,12 @@ "regexes": [ "^DATASTORE|CLOUD_SQL$" ] + }, + { + "name": "jpaTransactionManagerType", + "label": "The type of JPA transaction manager to use if using SQL", + "helpText": "The standard SQL instance or a read-only replica may be used", + "regexes": ["^REGULAR|READ_ONLY_REPLICA$"] } ] }