Stream sync generates an empty `FOR TABLE` clause for a standalone Patroni slot
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in pkg/cluster/streams.go at the stream sync logic around the linked lines 125–140 and 380–422; trace how standalone Patroni slots reach publication creation. Check the existing behavior described in PR #2868 and the SQL execution path in pkg/cluster/database.go. Done when an empty table map with no existing publication keeps the slot in slotsToSync and skips CREATE PUBLICATION.
Written by the indexing model from the issue text.
Description
Description
When a cluster uses event streams, it can also define a logical replication slot in spec.patroni.slots for a separate consumer. If no stream supplies tables for that slot and no publication with the same name exists, the operator adds the slot with an empty table map and queues a CREATE PUBLICATION statement with an empty table list. PostgreSQL rejects the generated SQL on every sync.
Steps to reproduce
- Install the
FabricEventStreamCRD and configure apostgresqlresource with an active entry inspec.streams. - Add a separate logical replication slot in
spec.patroni.slots(for examplemy_custom_slot: {type: logical, database: foo, plugin: pgoutput}) in databasefoowithout an existing publication namedmy_custom_slot. - During stream sync, the operator executes:
CREATE PUBLICATION "my_custom_slot" FOR TABLE WITH (publish = 'insert, update');
Observed behavior
PostgreSQL rejects the statement with ERROR: syntax error at or near "WITH" (SQLSTATE 42601), and the operator logs a publication creation error on every reconcile.
Expected behavior
When a slot in spec.patroni.slots has no stream tables (len(newTables) == 0) and no existing publication, stream sync should keep the slot in slotsToSync and skip CREATE PUBLICATION. (PR #2868 preserves an existing publication for a standalone slot, whereas this case starts with no publication.)
- Dominant language
- Go
- Stars
- 5.3k
- Forks
- 1.1k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zalando/postgres-operator
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zalando/postgres-operator#3257 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zalando/postgres-operator#3254 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
zalando/postgres-operator#3253 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
zalando/postgres-operator#3182 · 1 comment ·
Maintainers usually reply within 2 days
-
dependencies good first issue ui
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
zalando/postgres-operator#3132 · 3 comments ·
Maintainers usually reply within 2 days
All issues in zalando/postgres-operator
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pg-sharding/spqr#3314 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[inputs.internal] README lists go_version tag on internal_gather instead of internal_agentPossibly taken @cvas22 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
influxdata/telegraf#20264 ·
Maintainers usually reply within 1 day
-
[Bug] Standalone migration breaks existing Ingress routes using the envoy-http Service port nameOpenaccepted bug wg/enterprise-environment
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#7483 · 1 comment ·
Maintainers usually reply within 1 day