MetadataStore updateObject API fails occasionally with a conditional check error.
- Lingua principale
- Java
- Stelle
- 8
- Fork
- 6
- Merge medio
- 13h 17m
- PR unite (30g)
- 2
Descrizione
The core of the updateObject API implementation is [here](https://github.com/adobe/S3-FileSystem/blob/main/src/main/java/com/adobe/s3fs/metastore/internal/dynamodb/storage/AmazonDynamoDBStorage.java#L83).
In some rare cases (mostly observed when running a very high number of metadata only operations against the file system: e.g. restoring an HBase snapshot into a directory) this method will fail with a ConditionalCheck.
What seems to be happening is that an I/O error occurs, on the server side in DynamoDB the operation completes successfully and the client retries the operation (since from its perspective it failed with an I/O error). At this point the operation fails because it is issued with a ConditionalCheck which is not idempotent.
The proposed solution is to handle this particular case: when we receive a ConditionalCheck failed error we should read the state of the item from DynamoDB and check it against the item state that was received as an update. If the two are equal that means the operation was in fact executed successfully in DynamoDB and we should not raise the error up the call stack.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da src/main/java/com/adobe/s3fs/metastore/internal/dynamodb/storage/AmazonDynamoDBStorage.java, nell’implementazione di updateObject. Traccia come vengono gestiti gli errori di ConditionalCheck e i tentativi di nuovo invio del client durante operazioni ad alto volume che riguardano solo i metadati. Il lavoro è completato quando un ConditionalCheck fallito viene soppresso solo se una successiva lettura da DynamoDB mostra che l’elemento memorizzato corrisponde all’aggiornamento richiesto; in caso contrario, l’errore continua a propagarsi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, java
- Ambito
- backend, database
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100