Skip to content

Commit c7e1fc1

Browse files
authored
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.
1 parent 0c0b0df commit c7e1fc1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/main/java/google/registry/flows/poll/PollRequestFlow.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import google.registry.model.poll.MessageQueueInfo;
3333
import google.registry.model.poll.PollMessage;
3434
import google.registry.model.poll.PollMessageExternalKeyConverter;
35+
import google.registry.persistence.IsolationLevel;
36+
import google.registry.persistence.PersistenceModule.TransactionIsolationLevel;
3537
import java.util.Optional;
3638
import javax.inject.Inject;
3739
import org.joda.time.DateTime;
@@ -47,6 +49,7 @@
4749
*
4850
* @error {@link PollRequestFlow.UnexpectedMessageIdException}
4951
*/
52+
@IsolationLevel(value = TransactionIsolationLevel.TRANSACTION_READ_COMMITTED)
5053
public final class PollRequestFlow implements TransactionalFlow {
5154

5255
@Inject ExtensionManager extensionManager;

0 commit comments

Comments
 (0)