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

START_REPLICATION cannot run inside a transaction block #80

Closed
1 task done
braincore opened this issue Dec 21, 2024 · 1 comment
Closed
1 task done

START_REPLICATION cannot run inside a transaction block #80

braincore opened this issue Dec 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@braincore
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.

Describe the bug / reproduction

I changed the stdout example to PipelineAction::CdcOnly from PipelineAction::Both. This triggers an immediate error:

2024-12-21T22:25:55.544192Z  INFO pg_replicate::pipeline::sources::postgres: starting cdc stream at lsn 0/1
2024-12-21T22:25:55.544598Z ERROR stdout: source error: replication client error: tokio_postgres error: db error: ERROR: START_REPLICATION cannot run inside a transaction block

System information

  • OS: Ubuntu 24.04
  • PostgreSQL: 16.4
@braincore braincore added the bug Something isn't working label Dec 21, 2024
cawfeecoder added a commit to cawfeecoder/pg_replicate that referenced this issue Jan 1, 2025
feat: add nats connector (for cdc events)

For the first part, fix START_REPLICATION cannot run inside a
transaction block for CDC only, which is caused by
PostgresSource::new opening a transaction, but never closing it
for CDC only. This can be remedied by committing that transaction
and offering an explicit start_transaction function to be called
in cases of not CDC only.

For the 2nd part, introduce a NATS connector (WIP,
this should probably create or get a stream in Jetstream
for persistence and needs some configuration options)
so we can propagate out CDC events onto a message broker

Refs: supabase#80
@cawfeecoder
Copy link

@braincore part of my PR addresses and handles this: #81

@imor imor closed this as completed in 9cdb976 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants