mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 12:07:51 +02:00
Change some READ_COMMITTED levels to REPEATABLE_READ (#1802)
Basically, any time we're loading a bunch of linked objects that might change, we want to have REPEATABLE_READ so that another transaction doesn't come along and smush whatever we think we're loading. The following instances of READ_COMMITTED haven't changed: - RdePipeline (it only loads immutable objects like histories) - Invoicing pipeline (only immutable objects like BillingEvents) - Spec11 (doesn't use any linked info from Domain) This also changes the PersistenceModule to use REPEATABLE_READ by default on the replica JPA TM, for the standard reasoning.
This commit is contained in:
parent
63680f16ad
commit
5b2c1ec655
3 changed files with 4 additions and 4 deletions
|
@ -91,7 +91,6 @@ public class ResaveAllEppResourcesPipeline implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupPipeline(Pipeline pipeline) {
|
void setupPipeline(Pipeline pipeline) {
|
||||||
options.setIsolationOverride(TransactionIsolationLevel.TRANSACTION_READ_COMMITTED);
|
|
||||||
if (options.getFast()) {
|
if (options.getFast()) {
|
||||||
fastResaveContacts(pipeline);
|
fastResaveContacts(pipeline);
|
||||||
fastResaveDomains(pipeline);
|
fastResaveDomains(pipeline);
|
||||||
|
@ -194,6 +193,7 @@ public class ResaveAllEppResourcesPipeline implements Serializable {
|
||||||
PipelineOptionsFactory.fromArgs(args)
|
PipelineOptionsFactory.fromArgs(args)
|
||||||
.withValidation()
|
.withValidation()
|
||||||
.as(ResaveAllEppResourcesPipelineOptions.class);
|
.as(ResaveAllEppResourcesPipelineOptions.class);
|
||||||
|
options.setIsolationOverride(TransactionIsolationLevel.TRANSACTION_REPEATABLE_READ);
|
||||||
new ResaveAllEppResourcesPipeline(options).run();
|
new ResaveAllEppResourcesPipeline(options).run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,7 @@ public abstract class PersistenceModule {
|
||||||
replicaInstanceConnectionName.ifPresent(
|
replicaInstanceConnectionName.ifPresent(
|
||||||
name -> overrides.put(HIKARI_DS_CLOUD_SQL_INSTANCE, name));
|
name -> overrides.put(HIKARI_DS_CLOUD_SQL_INSTANCE, name));
|
||||||
overrides.put(
|
overrides.put(
|
||||||
Environment.ISOLATION, TransactionIsolationLevel.TRANSACTION_READ_COMMITTED.name());
|
Environment.ISOLATION, TransactionIsolationLevel.TRANSACTION_REPEATABLE_READ.name());
|
||||||
return new JpaTransactionManagerImpl(create(overrides), clock);
|
return new JpaTransactionManagerImpl(create(overrides), clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ public abstract class PersistenceModule {
|
||||||
replicaInstanceConnectionName.ifPresent(
|
replicaInstanceConnectionName.ifPresent(
|
||||||
name -> overrides.put(HIKARI_DS_CLOUD_SQL_INSTANCE, name));
|
name -> overrides.put(HIKARI_DS_CLOUD_SQL_INSTANCE, name));
|
||||||
overrides.put(
|
overrides.put(
|
||||||
Environment.ISOLATION, TransactionIsolationLevel.TRANSACTION_READ_COMMITTED.name());
|
Environment.ISOLATION, TransactionIsolationLevel.TRANSACTION_REPEATABLE_READ.name());
|
||||||
return new JpaTransactionManagerImpl(create(overrides), clock);
|
return new JpaTransactionManagerImpl(create(overrides), clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class CreateSyntheticDomainHistoriesPipeline implements Serializable {
|
||||||
RegistryPipelineOptions options =
|
RegistryPipelineOptions options =
|
||||||
PipelineOptionsFactory.fromArgs(args).withValidation().as(RegistryPipelineOptions.class);
|
PipelineOptionsFactory.fromArgs(args).withValidation().as(RegistryPipelineOptions.class);
|
||||||
RegistryPipelineOptions.validateRegistryPipelineOptions(options);
|
RegistryPipelineOptions.validateRegistryPipelineOptions(options);
|
||||||
options.setIsolationOverride(TransactionIsolationLevel.TRANSACTION_READ_COMMITTED);
|
options.setIsolationOverride(TransactionIsolationLevel.TRANSACTION_REPEATABLE_READ);
|
||||||
String registryAdminRegistrarId =
|
String registryAdminRegistrarId =
|
||||||
DaggerCreateSyntheticDomainHistoriesPipeline_ConfigComponent.create()
|
DaggerCreateSyntheticDomainHistoriesPipeline_ConfigComponent.create()
|
||||||
.getRegistryAdminRegistrarId();
|
.getRegistryAdminRegistrarId();
|
||||||
|
|
Loading…
Add table
Reference in a new issue