Why does my Google Cloud Lifecycle rule decline to delete bucket objects

Viewed 250

I've defined a rule to delete objects in my bucket if they're more than one day old. But I've now been waiting over 24 hours now to observe the automatic deletion of Export folders created in the bucket via PubSub 72 hours ago - and they're still there! Can anyone suggest what might be going wrong?

As background, I can confirm that it's possible for me to delete these folders manually, so the problem can't be down to "retention" issues.

2 Answers

It now seems that the answer to my question is that I wasn't actually doing anything wrong - I just needed to be a bit more patient. When I looked in my bucket this morning, the contents had disappeared!

Google's Object Lifecycle Management document says that Cloud Storage regularly inspects all the objects in a bucket for which Object Lifecycle Management is configured, but doesn't define what is meant by "regularly". Ominously, it goes on to say that changes to your Lifecycle rules may take up to to 24 hours to come into effect, so you do get the impression that "regularly" might actually mean "infrequently"

Patience is not something you normally have to deploy in IT and I think the problem here is that you don't get the feedback you get used to seeing when a long-running background process is launched (eg index-creation). That said, I can see this is quite a hard IT problem for Google. Perhaps I should just be a bit more grateful that this excellent facility exists at all!

From this documentation I understand that the time setted to expire an object doesn't mean that your object will be inmediatly deleted, it's just the time when GCP stop charging you for that object. As Jhon said probably there is a periodic process that removes the object at a certain point

It will be usefull if you share with us the output of the following command just to check that everything is setted as intended

gsutil lifecycle get gs://BUCKET_NAME

Related