googleforgames / open-saves

Open Saves is a cloud native data store for game development.
Apache License 2.0
222 stars 23 forks source link

Remove more than once chunkRef write #403

Closed hongalex closed 2 years ago

hongalex commented 2 years ago

What happened: UploadChunk creates multiple writes to the ChunkRef datastore entity. This is because a ChunkRef is created initially and then eventually marked as Ready after the blob is uploaded to GCS.

At best this is inefficient, and at worst causes contention.

What you expected to happen: Only one write is made to the chunkref entity.

How to reproduce it (as minimally and precisely as possible): Upload a Chunk

Anything else we need to know?:

We can remove this by creating the ChunkRef after the blob is created. If this upload fails, we can cancel the blob write.

Environment: