Skip to content

Special case empty blob in cas service for read requests

Shivam Bairoliya requested to merge sbairoliya/special_case_empty into master

Before raising this MR, consider whether the following are required, and complete if so:

  • Unit tests
  • Metrics
  • Documentation update(s)

No Metrics changed

Description

The REAPI states

// Servers MUST behave as though empty blobs are always available, even if they
// have not been uploaded. Clients MAY optimize away the uploading or
// downloading of empty blobs.

The implementation was currently writing the empty blob to the underlying storage on each startup of the cas and bytestream service. This is not needed since we can just assume that the empty digest always exists

This also meant that if we are using a remote storage option then we are introducing a dependency on the remote cas service being up and running at the start of the service, which can potentially become a circular dependency.

Changes proposed in this merge request:

  • If the empty blob is part of the FindMissingBlobs request no need to look into the storage of the blob, as it can never be missing
  • If the empty blob is part of BatchReadBlobs then remove it from the lists of input to search the underlying storage
  • If the empty blob is part of ByteStream Read call then no need to look into storage just return the empty blob

Validation

Unit Tests

Issues addressed

Closes / Resolves / Addresses (delete as appropriate) issue <e.g. repo-name#x>

Merge request reports