1
0
mirror of https://github.com/google/nomulus synced 2026-04-16 14:37:30 +00:00

Use repeatable-read in some batch actions (#2557)

This commit is contained in:
Weimin Yu
2024-09-16 14:56:33 -04:00
committed by GitHub
parent c3d164d462
commit 9db016638e
3 changed files with 6 additions and 1 deletions

View File

@@ -13,6 +13,7 @@
// limitations under the License.
package google.registry.batch;
import static google.registry.persistence.PersistenceModule.TransactionIsolationLevel.TRANSACTION_REPEATABLE_READ;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
import static google.registry.util.DateTimeUtils.END_OF_TIME;
@@ -89,7 +90,7 @@ public class CheckBulkComplianceAction implements Runnable {
@Override
public void run() {
tm().transact(this::checkBulkPackages);
tm().transact(TRANSACTION_REPEATABLE_READ, this::checkBulkPackages);
}
private void checkBulkPackages() {

View File

@@ -16,6 +16,7 @@ package google.registry.batch;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static google.registry.persistence.PersistenceModule.TransactionIsolationLevel.TRANSACTION_REPEATABLE_READ;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
import static google.registry.request.Action.Method.POST;
import static google.registry.request.RequestParameters.PARAM_DRY_RUN;
@@ -90,6 +91,7 @@ public class DeleteLoadTestDataAction implements Runnable {
"This action is not safe to run on PRODUCTION.");
tm().transact(
TRANSACTION_REPEATABLE_READ,
() -> {
LOAD_TEST_REGISTRARS.forEach(this::deletePollMessages);
tm().loadAllOfStream(Contact.class).forEach(this::deleteContact);

View File

@@ -16,6 +16,7 @@ package google.registry.export;
import static com.google.common.base.Verify.verifyNotNull;
import static google.registry.model.tld.Tlds.getTldsOfType;
import static google.registry.persistence.PersistenceModule.TransactionIsolationLevel.TRANSACTION_REPEATABLE_READ;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
import static google.registry.request.Action.Method.POST;
import static java.nio.charset.StandardCharsets.UTF_8;
@@ -70,6 +71,7 @@ public class ExportDomainListsAction implements Runnable {
tld -> {
List<String> domains =
tm().transact(
TRANSACTION_REPEATABLE_READ,
() ->
// Note that if we had "creationTime <= :now" in the condition (not
// necessary as there is no pending creation, the order of deletionTime