golang-samples
golang-samples copied to clipboard
feat(spanner): add change streams transaction exclusion sample
Add sample for how to configure change streams transaction exclusion in various write APIs.
Note: the current latest release of spanner go client library does not contain the source code change in https://github.com/googleapis/google-cloud-go/pull/9779 yet, so there will be build failures in CI/CD. However I have verified that all IT tests passed after pointing the go client dependency to my newest local cloned copy.
This pr will not be merged until the latest go client release contains the necessary source code change, just uploading it now to kick off the review process earlier.
Here is the summary of changes.
You are about to add 1 region tag.
- spanner/spanner_snippets/spanner/spanner_change_streams_txn_exclusion.go:17, tag
spanner_set_exclude_txn_from_change_streams
This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:
- [ ] Refresh this comment
CI is still reporting failures:
integration_test.go:1167: failed to commit rw txn excluded from change streams: spanner: code = "Unimplemented", desc = "ExcludeTxnFromChangeStreams is not enabled."
integration_test.go:418: got output ""; want it to contain "New singer inserted."
integration_test.go:419: got output ""; want it to contain "Singer first name updated."
integration_test.go:1167: failed to apply mutations excluded from change streams: spanner: code = "Unimplemented", desc = "ExcludeTxnFromChangeStreams is not enabled."
integration_test.go:421: got output ""; want it to contain "New singer inserted."
integration_test.go:1167: failed to apply at least once mutations excluded from change streams: spanner: code = "Unimplemented", desc = "ExcludeTxnFromChangeStreams is not enabled."
integration_test.go:423: got output ""; want it to contain "New singer inserted."
integration_test.go:1167: failed to write data using BatchWrite excluded from change streams: rpc error: code = Unimplemented desc = ExcludeTxnFromChangeStreams is not enabled.
integration_test.go:1167: failed to update using partitioned DML excluded from change streams: spanner: code = "Unimplemented", desc = "ExcludeTxnFromChangeStreams is not enabled."
integration_test.go:427: got output ""; want it to contain "record(s) updated"
Is this expected? (or do we just need to update the client library version?)
We should hold off merging this until CI passes, as we do not want to have broken samples included in our documentation. please let me know how you'd like to proceed.
CI is still reporting failures:
integration_test.go:1167: failed to commit rw txn excluded from change streams: spanner: code = "Unimplemented", desc = "ExcludeTxnFromChangeStreams is not enabled." integration_test.go:418: got output ""; want it to contain "New singer inserted." integration_test.go:419: got output ""; want it to contain "Singer first name updated." integration_test.go:1167: failed to apply mutations excluded from change streams: spanner: code = "Unimplemented", desc = "ExcludeTxnFromChangeStreams is not enabled." integration_test.go:421: got output ""; want it to contain "New singer inserted." integration_test.go:1167: failed to apply at least once mutations excluded from change streams: spanner: code = "Unimplemented", desc = "ExcludeTxnFromChangeStreams is not enabled." integration_test.go:423: got output ""; want it to contain "New singer inserted." integration_test.go:1167: failed to write data using BatchWrite excluded from change streams: rpc error: code = Unimplemented desc = ExcludeTxnFromChangeStreams is not enabled. integration_test.go:1167: failed to update using partitioned DML excluded from change streams: spanner: code = "Unimplemented", desc = "ExcludeTxnFromChangeStreams is not enabled." integration_test.go:427: got output ""; want it to contain "record(s) updated"Is this expected? (or do we just need to update the client library version?)
We should hold off merging this until CI passes, as we do not want to have broken samples included in our documentation. please let me know how you'd like to proceed.
Hi! Sorry for the confusion, I just converted this cl into a draft. Yes this is expected since this feature is still under limited visibility. I'll re-open this pr once this feature is turned on by default in production. Thanks!
It looks like this PR has been in draft form for several months. @ShuranZhang I'm going to close it, for now. Feel free to create a new PR from your local branch when the sample is ready. Thank you!