Stream sync generates an empty `FOR TABLE` clause for a standalone Patroni slot

オープン 初心者向け
#3,252 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, kubernetes, postgresql
領域
backend, databases

調査の方向性

pkg/cluster/streams.go の、リンクされた125~140行目および380~422行目付近にあるストリーム同期ロジックから始め、単独の Patroni スロットがどのように publication の作成に至るかを追跡してください。PR #2868 で説明されている既存の動作と、pkg/cluster/database.go の SQL 実行経路を確認してください。テーブルマップが空で既存の publication がない場合にスロットが slotsToSync に残り、CREATE PUBLICATION がスキップされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

  1. Install the FabricEventStream CRD and configure a postgresql resource with an active entry in spec.streams.
  2. Add a separate logical replication slot in spec.patroni.slots (for example my_custom_slot: {type: logical, database: foo, plugin: pgoutput}) in database foo without an existing publication named my_custom_slot.
  3. 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.)

主要言語
Go
スター
5.3k
フォーク
1.1k
平均マージ
3日 17時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zalando/postgres-operator のほかの issue

zalando/postgres-operator の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。