Skip to content

docstore: Add atomic write single partition conformance test scenario#3681

Merged
vangent merged 1 commit into
google:masterfrom
kchoy-sfdc:atomicWriteSinglePartitionConf
Mar 26, 2026
Merged

docstore: Add atomic write single partition conformance test scenario#3681
vangent merged 1 commit into
google:masterfrom
kchoy-sfdc:atomicWriteSinglePartitionConf

Conversation

@kchoy-sfdc

Copy link
Copy Markdown
Contributor

docstore/all: Add atomic write test scenarios to cover cases where transaction is within a single partition using composite IDs. Refactor existing atomic write test flag to return an enum so that atomic write tests can be skipped based on support.

Context:

Different docstores provide varying levels of support for transactions / atomic writes, particularly with respect to partitions. For example, DynamoDB supports transactions that span multiple partitions (i.e., rows within a transaction can have different partition key values), whereas Cosmos DB requires all rows in a transaction to reside within a single partition (the partition key must be identical across all rows in the transaction).

The existing conformance test scenario introduced in PR #3523 only covers the multi-partition case. We should add additional test scenarios to cover single-partition atomic writes, using data with composite IDs/keys.

Additionally, the SupportsAtomicWrites() check on the Harness interface should be refactored to return more granular levels of support—such as no support, single-partition transactions, and multi-partition transactions. This would allow each docstore driver to accurately declare its level of atomic write support in its Harness implementation, enabling conformance tests to be conditionally skipped when a given level of support is not available.

@kchoy-sfdc

Copy link
Copy Markdown
Contributor Author

@sandeepvinayak FYI

@sandeepvinayak

Copy link
Copy Markdown
Contributor

@jba @vangent This is a follow up test scenarios fix after original work in #3501

Even though we covered in the design that cosmos support single partition atomic writes, but existing conformance test was written for multi-partitions. The current tests are successful because cosmos doesn't have recordings or runs in replay mode. So in here instead of broader SupportAtomicWrites we are switching to Kind with values no support, single partition support, multi-partition support.

@vangent

vangent commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@vangent vangent merged commit bc85e4b into google:master Mar 26, 2026
5 checks passed
@kchoy-sfdc kchoy-sfdc deleted the atomicWriteSinglePartitionConf branch March 26, 2026 18:07
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.

3 participants