I am trying to achieve strong consistency with ndb using python. And it seems that I'm missing something, as my readings behave as if they do not correspond to each other.
Inquiry:
links = Link.query(ancestor=lead_key).filter(Link.last_status == None).fetch(keys_only=True) if links: do_action()
Key structure:
Lead root (generic key) -> Lead -> Website (one per lead) -> Link
I have many tasks that are executed simultaneously using TaskQueue, and this query is executed at the end of each task. Sometimes I get an “too many conflicts” exception when updating a field last_status, but I communicate with it through attempts. Can it break strong coherence?
last_status
The expected behavior is caused do_action()when there are no links left with last_statusequal None. Actual behavior is inconsistent: sometimes it do_action()is called twice, and sometimes it is not called at all.
do_action()
None
: . - . Sharding Counters . , , , - .
, , .
, , , .
, , , ( , ), . too much contention , . , !
too much contention
: , , GAE !
, , , . , , , do_action(), .
, , / ( ). , ( ), , . , , , . :)
, do_action - Link, , last_status.
, , ( ) , Link ( , ).
, , , , . , - (, http- ), HTTP- , .
Source: https://habr.com/ru/post/1677426/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1677421/does-amazon-sns-support-window-desktop-notification&usg=ALkJrhizyRTPlybB0MhJNUXrTkfSVld9Iwscala convert Int => Seq [Int] to Seq [Int => Int] - scalaКак назначить custome определить уникальный номер для entitiy в GAE? - javaWhy does Google Cloud SQL (using JDBC) take longer to insert records from the Google App Engine than from my personal computer? - google-app-engineIs it possible to use an interactive C # window instead of an “immediate” window in VS2017 - debuggingVisual Studio 2015 Interactive Window - c #Using Firebase Phone number Auth with response - react-nativeExclude Elm source files from SBT binary distribution - elmClojure install vs standalone vs dedupe? - clojureWhy a long Python script called from PHP doesn't work - pythonAll Articles