Skip to content

storage/cloud: revise file existance guarantees in ExternalStorage interface #49093

@pbardea

Description

@pbardea

This issue summarizes a discussion between @miretskiy and me about the ExternalStorage interface and possible improvements.

Backup currently uses the ReadFile method of the ExternalStorage interface to check if a file exists. This method currently supplies the caller a reader for a requested name. The current expectation is that ReadFile will return an error if the file does not exist. This at the very least should be enforced with tests. However, we should revise if we think that this is the best API to check for the presence of a file. Some possibilities include:

  • Using the existing Size method
  • Add an Stat/Attrs method. Similar to the existing Size method, and stat is sometimes used in Linux systems to check for file existence. In addition, it may provide useful information such as file checksums.
  • Document and test that ReadFile does always return an error in the case the named file does not exist.

Metadata

Metadata

Assignees

Labels

A-disaster-recoveryC-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions