GCP Associate Cloud Engineer Practice Question 77: Restore Object Version

Google Cloud Associate Cloud Engineer · Test 8 · question 7 of 10

Cloud Storagemedium

A script running with incorrect permissions accidentally overwrote report.csv in a Cloud Storage bucket that has object versioning enabled. The current object content is wrong, but you need to restore the file to the content it had before the overwrite. What should you do?

Select one answer
Show answer and explanation

Answer:

  • C. List the noncurrent versions of report.csv, identify the generation number from before the overwrite, and copy that generation over the current object.

With object versioning on, an overwrite does not destroy the old content; it becomes a noncurrent version identified by a generation number. Listing versions with the -a flag lets you find the generation that existed before the overwrite, and you can copy that specific generation back onto the live object to restore it.

Option A, soft delete, protects against deletion or overwrite for a short retention window too, but it restores a whole bucket to a point in time, not a single object, and the scenario describes versioning as the mechanism already in place; that is a heavier and less targeted action here. Option B is backwards: a lifecycle rule that deletes noncurrent versions destroys the very versions you need to recover from, it does not restore anything. Option D is fictional; Cloud Storage does not maintain a separate automatic nearline backup of every write outside of the version history you already control.

Reference: Using object versioning, restoring noncurrent object versions

Practice Test 8 ›

Study guides for Google Cloud Associate Cloud Engineer