oracle / oracle/oci-python-sdk

Potential data corruption issue for PythonSDK retry on binary data upload

Open
#203 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
474
Forks
321
Avg merge
23m
Merged PRs (30d)
4

Description

Update: this issue is now resolved in versions 2.9.0 and later.

If you are using ObjectStorageClient.put_object with retries enabled, or are using UploadManager.upload_file, you may be impacted.

Assuming you are uploading a 350MB file and, during upload, the connection is dropped such that the client must retry 2 times, with the first retry being after 50MB was uploaded and the second retry being after 200MB was uploaded, the end result would be that only the last 100MB of the file are stored by the service.

We are actively working on a fix for this issue. In the mean time, here are some workarounds which will allow you to avoid the issue:

For ObjectStorageClient.put_object, by default you would not be affected by this issue, because retries are not configured by default in the Python SDK (except on UploadManager). That said, if you are using ObjectStorageClient.put_object with retries enabled, you can use any of the following workarounds to avoid the issue:

  • Disable retries on ObjectStorageClient.put_object
  • Explicitly set the content_length parameter of ObjectStorageClient.put_object to the file size of the file to upload
  • Explicitly set the content_md5 parameter of ObjectStorageClient.put_object to the base-64 encoded md5 hash of the file to upload

For UploadManager.upload_file, by default this operation is impacted by this issue, and a workaround is required to avoid the problem:

This issue can also impact other operations in the Python SDK which send binary bodies. However, by default you would not be affected by this issue in any of those operations, because retries are not configured by default in the Python SDK (except on UploadManager). That said, even if you have retries configured for any of these operations, in most cases you will get a service error (rather than a silent failure like with Object Storage) because the service will notice the data corruption. However, to be most safe, in any operation which sends a binary body it is best to explicitly disable retries until this issue is resolved.

We apologize for any inconvenience this issue may cause you. We are working to promptly resolve this issue. Please stay tuned and watch this GitHub issue for updates.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names ObjectStorageClient.put_object and UploadManager.upload_file as affected entry points, with retry.py and upload_manager.py links for retry configuration. It states the problem is resolved in version 2.9.0 and later; verify the relevant release behavior and confirm binary uploads remain intact after retries.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.