-
Notifications
You must be signed in to change notification settings - Fork 4.1k
storage/cloud: revise file existance guarantees in ExternalStorage interface #49093
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-disaster-recoveryC-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.
Description
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
Sizemethod - Add an
Stat/Attrsmethod. Similar to the existingSizemethod, andstatis 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
ReadFiledoes always return an error in the case the named file does not exist.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-disaster-recoveryC-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.