mirror of
https://github.com/google/nomulus
synced 2026-02-03 11:32:24 +00:00
Retry any Datastore reads in EppResource map-reduce input
Datastore has a non-zero chance of failing on reads. A map-reduce with too many failures will eventually give up. As a result, any map-reduce that goes over a large number of datastore entities is almost guaranteed to fail. Since we expect to have a large number of EppResources, we make sure to wrap all datastore reads with some retrying mechanism to reduce the number of transient failures that propagate to Map-Reduce. This feature already existed for CommitLogManifestReader, we refactor the code to use the same retrying mechanism in EppResource readers. Also removed the transactNew around the reads because looking at the source - it doesn't actually do anything we need (doesn't retry on any failure other than concurrency failure) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=190633281
This commit is contained in:
@@ -56,9 +56,9 @@ class EppResourceEntityReader<R extends EppResource> extends EppResourceBaseRead
|
||||
*/
|
||||
@Override
|
||||
public R next() throws NoSuchElementException {
|
||||
// Loop until we find a value, or nextEri() throws a NoSuchElementException.
|
||||
// Loop until we find a value, or nextQueryResult() throws a NoSuchElementException.
|
||||
while (true) {
|
||||
Key<? extends EppResource> key = nextEri().getKey();
|
||||
Key<? extends EppResource> key = nextQueryResult().getKey();
|
||||
EppResource resource = ofy().load().key(key).now();
|
||||
if (resource == null) {
|
||||
logger.severefmt("EppResourceIndex key %s points at a missing resource", key);
|
||||
|
||||
Reference in New Issue
Block a user