2

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)?

Evgeny Timoshenko
  • 3,119
  • 5
  • 33
  • 53

1 Answers1

5

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.

Brandon Yarbrough
  • 37,021
  • 23
  • 116
  • 145
  • 1
    seems like it is not longer true, per the linked documentation, object listing is also strongly consistent – user375868 Jan 26 '22 at 18:10