Add account to migration retry table on transient dynamo failure
This commit is contained in:
parent
b91a69d8b3
commit
f3b9a8d97f
|
@ -214,6 +214,7 @@ public class AccountsDynamoDb extends AbstractDynamoDbStore implements AccountSt
|
||||||
throw new IllegalArgumentException(e);
|
throw new IllegalArgumentException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
try {
|
try {
|
||||||
UpdateItemResponse response = client.updateItem(updateItemRequest);
|
UpdateItemResponse response = client.updateItem(updateItemRequest);
|
||||||
|
|
||||||
|
@ -228,6 +229,12 @@ public class AccountsDynamoDb extends AbstractDynamoDbStore implements AccountSt
|
||||||
// but we can infer it was an optimistic locking failure if the UUID is known
|
// but we can infer it was an optimistic locking failure if the UUID is known
|
||||||
throw get(account.getUuid()).isPresent() ? new ContestedOptimisticLockException() : e;
|
throw get(account.getUuid()).isPresent() ? new ContestedOptimisticLockException() : e;
|
||||||
}
|
}
|
||||||
|
} catch (final Exception e) {
|
||||||
|
// the Dynamo account now lags the Postgres account version. Put it in the migration retry table so that it will
|
||||||
|
// get updated faster—otherwise it will be stale until the accounts crawler runs again
|
||||||
|
migrationRetryAccounts.put(account.getUuid());
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue