Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(spanner): add change streams transaction exclusion sample #4108

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ShuranZhang
Copy link

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 googleapis/google-cloud-go#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.

@ShuranZhang ShuranZhang requested review from a team as code owners April 25, 2024 00:15
Copy link

snippet-bot bot commented Apr 25, 2024

Here is the summary of changes.

You are about to add 1 region tag.

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

@product-auto-label product-auto-label bot added api: spanner Issues related to the Spanner API. samples Issues that are directly related to samples. labels Apr 25, 2024
@ShuranZhang ShuranZhang force-pushed the change-streams-txn-exclusion branch 2 times, most recently from 88370b5 to cfdb7cf Compare April 25, 2024 01:07
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 29, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 29, 2024
@muncus muncus added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2024
@muncus
Copy link
Collaborator

muncus commented Jun 13, 2024

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.

@muncus muncus assigned muncus and ShuranZhang and unassigned muncus Jun 13, 2024
@ShuranZhang ShuranZhang marked this pull request as draft June 13, 2024 21:32
@ShuranZhang
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants