1

I executed a large query and gets a RequestRateTooLargeException because of temporary high load. When I look in the database a few of the created entries already exists which leads to a ConflictException on a retry with the same ids.

This effect can be simulated with following gremlin query:

g.addV('MyVertex').property(id,'33748fd1-32ff-440f-a261-580dbde4eece').property(single,'PartitionKey','PartitionKey').
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A'))).
sideEffect(__.addE('HasMassMembers').to(__.addV('MassMembers').property(single,'PartitionKey','PartitionKey').property(single,'PropertyA','A').property(single,'PropertyB','A').property(single,'PropertyC','A').property(single,'PropertyD','A').property(single,'PropertyE','A').property(single,'PropertyF','A').property(single,'PropertyG','A').property(single,'PropertyH','A').property(single,'PropertyI','A').property(single,'PropertyJ','A').property(single,'PropertyK','A').property(single,'PropertyL','A').property(single,'PropertyM','A').property(single,'PropertyN','A').property(single,'PropertyO','A').property(single,'PropertyP','A').property(single,'PropertyQ','A').property(single,'PropertyR','A').property(single,'PropertyS','A').property(single,'PropertyT','A').property(single,'PropertyU','A').property(single,'PropertyV','A').property(single,'PropertyW','A').property(single,'PropertyX','A').property(single,'PropertyY','A').property(single,'PropertyZ','A')))

With an RU-Limit of 400, this produces the exception. If not, you can repeat the sideEffect line (don't forget the dot at the end of each line).

As I understand https://learn.microsoft.com/en-us/azure/cosmos-db/sql/database-transactions-optimistic-concurrency this single operation (with a lot of side-effect operations) should either succeed or fail together.

The database engine in Azure Cosmos DB supports full ACID (Atomicity, Consistency, Isolation, Durability) compliant transactions with snapshot isolation. All the database operations within the scope of a container's logical partition are transactionally executed within the database engine that is hosted by the replica of the partition. These operations include both write (updating one or more items within the logical partition) and read operations.

But when I execute g.V('33748fd1-32ff-440f-a261-580dbde4eece') a result is returned.

Is this a bug in CosmosDb or is my query wrong?

0 Answers0