From c7e1fc17d27cc7dc19dd890c2340c800e1c18db1 Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Thu, 21 Nov 2024 17:49:57 -0500 Subject: [PATCH] Downgrade the tx isolation level of poll message request flow (#2614) It doesn't need a higher transaction isolation level as it's only loading a given poll message once, and we want to avoid putting any kind of locks on the PollMessage table as it seems to be having contention issues. Note that the poll message request flow is by far the most frequent code that touches the PollMessage table, as there are many many requests every minute from dozens of registrars, but much fewer poll messages than that to actually ACK. --- .../main/java/google/registry/flows/poll/PollRequestFlow.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/google/registry/flows/poll/PollRequestFlow.java b/core/src/main/java/google/registry/flows/poll/PollRequestFlow.java index 92f74399b2e..14a4beb7dea 100644 --- a/core/src/main/java/google/registry/flows/poll/PollRequestFlow.java +++ b/core/src/main/java/google/registry/flows/poll/PollRequestFlow.java @@ -32,6 +32,8 @@ import google.registry.model.poll.MessageQueueInfo; import google.registry.model.poll.PollMessage; import google.registry.model.poll.PollMessageExternalKeyConverter; +import google.registry.persistence.IsolationLevel; +import google.registry.persistence.PersistenceModule.TransactionIsolationLevel; import java.util.Optional; import javax.inject.Inject; import org.joda.time.DateTime; @@ -47,6 +49,7 @@ * * @error {@link PollRequestFlow.UnexpectedMessageIdException} */ +@IsolationLevel(value = TransactionIsolationLevel.TRANSACTION_READ_COMMITTED) public final class PollRequestFlow implements TransactionalFlow { @Inject ExtensionManager extensionManager;