Manutenção de Openflow Connector for PostgreSQL¶
Nota
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.
Atualização do PostgreSQL¶
Atualizar o conector requer uma abordagem diferente, dependendo se o PostgreSQL está sendo atualizado para a próxima versão secundária ou principal.
Atualizações de versões secundárias
São seguras para os dados.
Não exigem tratamento especial.
Exigem a interrupção do conector durante a atualização para evitar relatar problemas de conectividade.
Continuam replicando após a atualização, sem perda de dados.
Atualizações da versão principal
Exigem que o servidor PostgreSQL descarte slots de replicação, incluindo aqueles usados pelo conector.
Não conseguem preservar ou migrar slots de replicação para a nova versão. Consulte também Atualizações para versões PostgresSQL 17 e posteriores.
Reiniciam a replicação de todas as tabelas da fase de instantâneo anterior.
Para realizar uma atualização de versão secundária, faça o seguinte:
Interrompa o conector, incluindo todos os processadores e serviços dele.
Atualize o PostgreSQL.
Reinicie o conector.
Para realizar uma atualização de versão principal, faça o seguinte:
Remova todas as tabelas da replicação no conector.
Aguarde até que todas as filas no conector estejam vazias.
Interrompa o conector, incluindo todos os processadores e serviços dele.
Abra o grupo Incremental Load no conector.
Clique com o botão direito do mouse no processador superior do grupo, Read PostgreSQL CDC Stream, e selecione View state.
Clique em Clear state.
Clique em Close.
Atualize o PostgreSQL.
Reinicie o conector. Um novo slot de replicação será criado.
Adicione novamente todas as tabelas para iniciar a replicação.
Atualizações para versões PostgresSQL 17 e posteriores¶
A atualização para a versão PostgreSQL 17 foi aprimorada de forma que não é mais necessário remover slots de replicação ao atualizar para versões posteriores, como 17.1 » 18.0. A atualização para a versão PostgreSQL 17.0 ou posterior a partir de versões anteriores (16 e anteriores) remove slots de replicação e deve ser tratada como uma atualização principal. Versões futuras do PostgreSQL também podem aprimorar ainda mais o processo de atualização.
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.
Aviso
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.
Cuidado
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 Configure o 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.