Tom Lous
Tom Lous

Reputation: 2909

Google cloud storage lifecycle configuration filesize?

I've been trying to implement lifecycle management to objects I store in my GCP storage with no overall success.

First of all I have a bucket that stores objects per date. (intermediate & files of pipeline runs) So I want to retain, say maybe 10 days past, but then I want to move to more archived uses.

So on this storage bucket I've created the following lifecycle.json:

{
   "lifecycle":{
      "rule":[
         {
            "action":{
               "type":"SetStorageClass",
               "storageClass":"NEARLINE"
            },
            "condition":{
               "age":3,
               "matchesStorageClass":[
                   "REGIONAL",                  
                  "STANDARD",
                  "DURABLE_REDUCED_AVAILABILITY"
               ]
            }
         },
         {
            "action":{
               "type":"SetStorageClass",
               "storageClass":"COLDLINE"
            },
            "condition":{
               "age":10,
               "matchesStorageClass":[
                  "NEARLINE"
               ]
            }
         },
         {
            "action":{
               "type":"Delete"
            },
            "condition":{
               "age":10,
               "matchesStorageClass":[
                  "COLDLINE"
               ]
            }
         }
      ]
   }
}

Based on this manual: https://cloud.google.com/storage/docs/managing-lifecycles#enable

When I set the lifecycle using gsutil it accepts it, and when I get it it shows it.

But not all files seem to be affected by the configuration and I'm having this theory that it depends on filesize, e.g. sizesstorage

All files were uploaded on the same exact day (with 1 hour window). but only some are nearline, some are still regional. In this directory the tipping point is around 100MB, but in another a 300MB+ file makes it into nearline

large

My questions:

--- Update 20170720 ---

As per requested I've ran the command:

gsutil ls -L gs://yourbucket

One large csv file, which should be removed by now:

Creation time:          Tue, 27 Jun 2017 12:23:08 GMT
Update time:            Tue, 27 Jun 2017 12:23:08 GMT
Storage class:          REGIONAL
Content-Length:         1184976409
Content-Type:           text/csv
Component-Count:        23
Hash (crc32c):          ggHfjw==
ETag:                   COqC4oqC3tQCEAE=
Generation:             1498566188630378
Metageneration:         1

The directory of files from the screenshot has been processed and everything was deleted below a certain filesize:

The files remaining should also have been deleted:

Creation time:          Sat, 08 Jul 2017 10:00:57 GMT
Update time:            Sat, 08 Jul 2017 10:00:57 GMT
Storage class:          REGIONAL
Content-Length:         469342393
Content-Type:           application/octet-stream
Component-Count:        9
Hash (crc32c):          Ux3HKw==
ETag:                   COLb3ei2+dQCEAE=
Generation:             1499508057271778
Metageneration:         1
ACL:                    [

So we can rule out the fact that the file was modified in the mean time.

Upvotes: 0

Views: 603

Answers (1)

Tom Lous
Tom Lous

Reputation: 2909

This seems to have been fixed in the mean time

Upvotes: 0

Related Questions