Openflow Connector for PostgreSQL のメンテナンス¶
注釈
This connector is subject to the Snowflake Connector Terms.
This topic describes important maintenance considerations and best practices for maintaining the Openflow Connector for PostgreSQL when making changes to the source PostgreSQL database. In addition this topic describes how to reinstall the connector.
PostgreSQL アップグレード中¶
コネクタのアップグレードは、PostgreSQL が次のマイナーバージョンまたはメジャーバージョンにアップグレードされるかどうかに応じて異なるアプローチが必要です。
マイナーバージョンのアップグレード
データは安全です。
特別な扱いは必要ありません。
接続の問題を報告しないために、アップグレード期間中はコネクタを停止する必要があります。
アップグレード後も、データを失うことなく複製を続行します。
メジャーバージョンのアップグレード
コネクタが使用しているものも含め、PostgreSQL サーバーに複製スロットを削除させる必要があります。
複製スロットを新しいバージョンに保持または移行することはできません。PostgresSQL 17以降のバージョンのアップグレード もご参照ください。
以前のスナップショットフェーズからのすべてのテーブルの複製を再開します。
マイナーバージョンのアップグレードを実行するには、次を実行します。
すべてのプロセッサーと制御サービスを含む、コネクタを停止します。
PostgreSQL をアップグレードします。
コネクタを再起動します。
メジャーバージョンアップグレードを実行するには、次を実行します。
コネクタで複製からすべてのテーブルを削除します。
コネクタ内のすべてのキューが空になるまで待ちます。
すべてのプロセッサーと制御サービスを含む、コネクタを停止します。
コネクタの Incremental Load グループを開きます。
Read PostgreSQL CDC Stream グループの一番上のプロセッサーを右クリックします。また、View state を洗濯します。
Clear state をクリックします。
Close をクリックします。
PostgreSQL をアップグレードします。
コネクタを再起動します。新しい複製スロットが作成されます。
すべてのテーブルを再追加して複製を開始します。
PostgresSQL 17以降のバージョンのアップグレード¶
PostgreSQL 17 のアップグレードを改善し、17.1 » 18.0などの新しいバージョンにアップグレードするときに、複製スロットをドロップする必要がなくなりました。以前のバージョン(16以前)から PostgreSQL 17.0以降にアップグレードすると、複製スロットがドロップするため、メジャーアップグレードとして扱う必要があります。PostgreSQL の将来のバージョンは、アップグレードプロセスをさらに改善する可能性があります。
Reinstall the connector¶
This section describes how to reinstall the connector. It covers situations where the new connector is installed in the same runtime, or when it is moved to a new runtime. Reinstall is often used in conjunction with Incremental replication with snapshots.
警告
For the connector to be able to continue replicating from the same CDC stream position where it stopped before reinstallation,
the source database must retain the WAL long enough to cover the time since the old connector is stopped and the new connector is started.
Ensure the max_wal_size parameter of the PostgreSQL server is high enough, depending on your traffic, and keep the reinstallation time to a minimum.
Prerequisites¶
Review and note connector parameter context values. If you're reinstalling the connector in the same runtime, you can reuse the existing context. If the new instance will be located in a different runtime, you will have to re-enter all parameters.
To reinstall the connector:
Finish processing all in-flight FlowFiles in the existing connector, and then stop the connector.
Sign in to Snowsight.
In the navigation menu, select Ingestion » Openflow.
In the Openflow pane select the Runtimes tab.
Select the runtime containing the connector.
Select the connector.
Stop the topmost processor Set Tables for Replication in the Snapshot Load group.
Stop the topmost processor Read PostgreSQL CDC Stream in the Incremental Load group.
If you changed the value of the Merge Task Schedule CRON parameter, return it to
* * * * * ?, otherwise queues will not be emptied until the next scheduled run.Wait until all FlowFiles in the connector have been processed, and all queues are empty. When all FlowFiles have been processed, the Queued value on the connector's processor group becomes zero. If there are any items left in the original connector's queues, there may be data gaps when the new connector starts.
Stop all processors and controller services in the connector.
Find and copy the name of the replication slot used by the original connector, by viewing the state of the topmost processor in the
Incremental Loadgroup with nameRead PostgreSQL CDC Stream. The replication slot name is stored under the keyreplication.slot.name. Copy the value of the key to a text editor.Create a new instance of the connector. If you're using the same runtime as the original connector, you can choose to keep the existing parameter contexts, and reuse the settings.
注意
The existing connector can remain in the runtime and doesn't interfere with the new instance, as long as it remains stopped.
If you're installing into a different runtime, or you deleted the previous parameter contexts, enter all the configuration settings into the new parameter contexts, including the table names and patterns as described in Openflow Connector for PostgreSQL の設定.
Open the
PostgreSQL Ingestion Parameterscontext, and setIngestion Typeparameter toincremental. For more information on the concerns see Enable incremental replication without snapshots.Open the
PostgreSQL Source Parameterscontext, and set theReplication Slot Nameparameter to the value you copied earlier.Start the new connector.
Usage notes¶
The new connector will use the same, existing destination tables that created by the original connector, but will create new journal tables.