Previously, we were indicating success even when that wasn't true, leading
to errors later when we went to read data we hadn't written. Now, the
caller can retry the put operation if needed.
} else if (async->op == STORE_OP_PUT) {
struct put_info info;
+ info.success = 0;
info.val = async->data;
info.offset = 0;
S3_put_object(&store->bucket, async->key, async->data->len, NULL, NULL,
&handler, &info);
- async->result = 0;
+ if (info.success) {
+ async->result = 0;
+ } else {
+ g_warning("Error completing S3 put operation; client must retry!");
+ }
}
bluesky_store_async_mark_complete(async);