TransactionFailedError (too much contention…) when reading (cross-group) entities from datastore

此生再无相见时 提交于 2019-12-02 04:34:25

In a transaction where there is at least one write, in this case Key(Target, Foo), Cloud Datastore will write no-op markets to the entity groups that are read but not modified. This is to ensure serializability.

Since Key(OriginGroup, 1) and you are doing XG transactions faster than 1 per second over an extended period, this is the source of our contention.

One alternative to consider is a batching strategy that writes 23 Key(Target, Foo) entities at a time rather than one. Key(Origin, 1) and Key(TargetConfig, 1) takes the other 2 entity-group slot.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!