Delete DynamoDB accounts with invalid UUIDs in AccountsManager#create
This commit is contained in:
parent
5c68d83a93
commit
2e28fb97a4
|
@ -260,9 +260,11 @@ public class AccountsDynamoDb extends AbstractDynamoDbStore implements AccountSt
|
|||
|
||||
@Override
|
||||
public void delete(UUID uuid) {
|
||||
DELETE_TIMER.record(() -> {
|
||||
delete(uuid, true);
|
||||
});
|
||||
DELETE_TIMER.record(() -> delete(uuid, true));
|
||||
}
|
||||
|
||||
public void deleteInvalidMigration(UUID uuid) {
|
||||
DELETE_TIMER.record(() -> delete(uuid, false));
|
||||
}
|
||||
|
||||
public AccountCrawlChunk getAllFrom(final UUID from, final int maxCount, final int pageSize) {
|
||||
|
|
|
@ -185,7 +185,12 @@ public class AccountsManager {
|
|||
(databaseResult, dynamoResult) -> {
|
||||
|
||||
if (!account.getUuid().equals(actualUuid)) {
|
||||
// This is expected towards the beginning of the background migration, as Dynamo won’t
|
||||
// have many accounts available for re-registration
|
||||
logger.warn("dynamoCreate() did not return correct UUID");
|
||||
accountsDynamoDb.deleteInvalidMigration(account.getUuid());
|
||||
return Optional.of("dynamoIncorrectUUID");
|
||||
|
||||
}
|
||||
|
||||
if (databaseResult.equals(dynamoResult)) {
|
||||
|
|
Loading…
Reference in New Issue