mirror of
https://github.com/google/nomulus
synced 2025-12-23 06:15:42 +00:00
Downgrade the tx isolation level of poll message ack flow (#2615)
This might help alleviate DB transaction contention on the PollMessage table. A lower transaction isolation level is safe because acking a poll message is idempotent: there are only two things it does, either delete a poll message or take a recurring one from the past and set it to be a year in the future from the date in the past. Both of these operations will always yield the same final result even if executed multiple times simultaneously for some reason.
This commit is contained in:
@@ -37,6 +37,8 @@ import google.registry.model.poll.MessageQueueInfo;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.poll.PollMessageExternalKeyConverter;
|
||||
import google.registry.model.poll.PollMessageExternalKeyConverter.PollMessageExternalKeyParseException;
|
||||
import google.registry.persistence.IsolationLevel;
|
||||
import google.registry.persistence.PersistenceModule.TransactionIsolationLevel;
|
||||
import google.registry.persistence.VKey;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
@@ -55,6 +57,7 @@ import org.joda.time.DateTime;
|
||||
* @error {@link PollAckFlow.MissingMessageIdException}
|
||||
* @error {@link PollAckFlow.NotAuthorizedToAckMessageException}
|
||||
*/
|
||||
@IsolationLevel(value = TransactionIsolationLevel.TRANSACTION_READ_COMMITTED)
|
||||
public final class PollAckFlow implements MutatingFlow {
|
||||
|
||||
@Inject ExtensionManager extensionManager;
|
||||
|
||||
Reference in New Issue
Block a user