google-cloud-storagegcloud-node

Is there any delay between file get uploaded and get listed?


I use gcloud node v0.24 for interacting with Google Cloud Storage. I've encountered an issue when immediate list after upload doesn't return all the files that were uploaded.

So the question is does Bucket#getFiles always list files right after Bucket#upload?

or

is there any delay between upload's callback and when file becomes available (e.g. can be listed, downloaded)?


Solution

  • Note: below answer is no longer up to date -- GCS object listing is strongly consistent.


    Google Cloud Storage provides strong global consistency for all read-after-write, read-after-update, and read-after-delete operations, including both data and metadata. As soon as you get a success response from an upload message, you may immediately read the object.

    However, object and bucket listing is only eventually consistent. Objects will show up in a list call after you upload them, but not necessarily immediately.

    In other words, if you know the name of an object that you have just uploaded, you can immediately download it, but you cannot necessarily discover that object by listing the objects in a bucket immediately.

    For more, see https://cloud.google.com/storage/docs/consistency.