Topic 9 Question 59
If you have object versioning enabled on a multi-regional bucket, what will the following lifecycle config file do? {"lifecycle": { "rule": [ { "action": {"type": "Delete"}, "condition": { "age": 30, "isLive": true } }, { "action": { "type": "SetStorageClass", "storageClass": "COLDLINE"}, "condition": { "age": 365, "matchesStorageClass": ["MULTI_REGIONAL"] } } ] } }
Archive objects older than 30 days (the second rule doesn't do anything)
Delete objects older than 30 days (the second rule doesn't do anything)
Archive objects older than 30 days and move objects to Coldline Storage after 365 days
Delete objects older than 30 days and move objects to Coldline Storage after 365 days
解説
If object versioning is enabled and the Delete rule has an "isLive:true" condition, then objects will be archived rather than deleted. If object versioning is disabled, then the first rule would actually delete objects after 30 days and the second rule would never match any objects. The question says that object versioning is enabled, so that's not the case. The second rule moves objects older than 365 days from Multi-Regional Storage to Coldline Storage. Since all live objects are archived after 30 days, only archived objects will be old enough to be moved by this rule. Also, since this is a Multi-Regional bucket, this rule will match all archived objects older than 365 days (other than those that have already been moved to Coldline Storage). Reference: https://cloud.google.com/storage/docs/managing-lifecycles
コメント(13)
Answer is C. My reasoning tells me there’s 3 parts to this. Here's what happens:
- Deletions always take precedence over SetStorage (so if any objects meet both rules when this is created - it will delete).
- The bucket has object versioning enabled. A deletion of a versioned object with isLive:true, simply removes the live object and creates a noncurrent version -which is essentially an archived version of the object.
- These noncurrent versions (considered archived) - are now moved to ColdLine Storage after 365 days
So reading C “Archive objects older than 30 days and move objects to Coldline Storage after 365 days” - makes most sense
👍 14rehma0172020/06/06The bucket has versioning enabled so the delete action on Live items (isLive:true) makes them non-current, does not delete them. Second rule moves to coldline. C is right.
👍 13mpguard2020/02/15i chose B because the second action does not have a value assigned to it while the first has action:delete
👍 9passnow2019/12/18
シャッフルモード