Skip to content

feat: add collection id to offloaded payload obj name & metadata - #2774

Merged
chenba merged 1 commit into
masterfrom
feat/gcs-obj-name-with-collection-id-stor-762
Dec 2, 2026
Merged

chenba merged 1 commit into
masterfrom
feat/gcs-obj-name-with-collection-id-stor-762

Conversation

@chenba

@chenba chenba commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Because:

  • we want to include the offloaded payload's collection id in the gcs object name

This commit:

  • looks up the collection id prior to gcs upload
  • adds the collection id to the gcs object name as well as the metadata

Closes STOR-762

@chenba
chenba force-pushed the feat/gcs-obj-name-with-collection-id-stor-762 branch from 8308f38 to 95fb53d Compare November 19, 2026 19:18
@chenba
chenba requested review from pjenvey and taddes November 19, 2026 19:48
@chenba
chenba force-pushed the feat/gcs-obj-name-with-collection-id-stor-762 branch from 95fb53d to 6ec9d9d Compare December 2, 2026 17:12
@chenba

chenba commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

@pjenvey I made changes to create the collection when the id's not found

@pjenvey pjenvey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for doing this!

Comment thread syncstorage-spanner/src/pool.rs Outdated
Comment on lines +135 to +140
// Outside a transaction, this also caches the id of an existing row.
match db._get_collection_id(name).await {
Err(e) if e.is_collection_not_found() => {}
result => return result,
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this call as a) we just checked the cache b) get_or_create_collection_id does it internally, albeit within a write transaction (not caching its result), but then we explicitly cache the result on success anyway, since it's safe to do so as we either successfully wrote or read it from the db or cache

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it.

Because:
 - we want to include the offloaded payload's collection id in the gcs
   object name

This commit:
 - looks up the collection id prior to gcs upload
 - adds the collection id to the gcs object name as well as the metadata
@chenba
chenba force-pushed the feat/gcs-obj-name-with-collection-id-stor-762 branch from 6ec9d9d to b6df24d Compare December 2, 2026 22:49
@chenba
chenba merged commit 7979fce into master Dec 2, 2026
32 checks passed
@chenba
chenba deleted the feat/gcs-obj-name-with-collection-id-stor-762 branch December 2, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants