-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #766 from Altinity/2.3.0
2.3.0
- Loading branch information
Showing
32 changed files
with
4,584 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## Handling PostgreSQL WAL Growth with Debezium Connectors | ||
Credits: https://medium.com/@pawanpg0963/postgres-replication-lag-using-debezium-connector-4ba50e330cd6 | ||
|
||
One of the common problems with PostgreSQL is the WAL size increasing. This issue can be observed when using Debezium connectors for change data capture. | ||
The WAL size increases due to the connector not sending any data to the replication slot. | ||
This can be observed by checking the replication slot lag using the following query: | ||
```sql | ||
postgres=# SELECT slot_name, pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) AS replicationSlotLag, | ||
pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), confirmed_flush_lsn)) AS confirmedLag, active FROM pg_replication_slots; | ||
slot_name | replicationslotlag | confirmedlag | active | ||
-----------+--------------------+--------------+-------- | ||
db1_slot | 20 GB | 16 GB | t | ||
db2_slot | 62 MB | 42 MB | t | ||
(2 rows) | ||
``` | ||
|
||
This issue can be addressed using the `heartbeat.interval.ms` configuration | ||
|
||
### Solution | ||
Create a new table in postgres (Heartbeat) table. | ||
```sql | ||
CREATE TABLE heartbeat.pg_heartbeat ( | ||
random_text TEXT, | ||
last_update TIMESTAMP | ||
); | ||
``` | ||
Add the table to the existing publisher used by the connector: | ||
```sql | ||
INSERT INTO heartbeat.pg_heartbeat (random_text, last_update) VALUES ('test_heartbeat', NOW()); | ||
``` | ||
Add the table to the existing publisher used by the connector: | ||
``` | ||
ALTER PUBLICATION db1_pub ADD TABLE heartbeat.pg_heartbeat; | ||
ALTER PUBLICATION db2_pub ADD TABLE heartbeat.pg_heartbeat; | ||
``` | ||
Grant privileges to the schema heartbeat and table pg_heartbeat to the replication user used by the connector. | ||
Add the following configuration to `config.yml` | ||
``` | ||
heartbeat.interval.ms=10000 | ||
heartbeat.action.query="UPDATE heartbeat.pg_heartbeat SET last_update=NOW();" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## What's Changed | ||
* Update Monitoring.md to include metrics.port by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/735 | ||
* Added integration test for PostgreSQL keepermap by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/728 | ||
* Enable metrics by default for MySQL and postgres by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/750 | ||
* Added documentation to set the replication start position by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/753 | ||
* Added documentation for using JAR file for postgres replication by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/754 | ||
* Update quickstart.md by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/763 | ||
* Update quickstart.md update docker tag. by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/764 | ||
* Removed schema history configuration settings for postgres by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/755 | ||
* 725 we cant start grafana in sink connector we have cert issue by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/760 | ||
* Added JMX exporter to export JMX metrics from debezium. by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/757 | ||
* Disable validation of source database by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/716 | ||
* Added Integration test to validate truncate event replication in post…gresql by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/759 | ||
* Fix set lsn to accept string and not long by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/752 | ||
* Added logic in retrying database in case of failure by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/761 | ||
* 630 postgres heartbeat setup documentation by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/765 | ||
* 628 add integration test for mariadb by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/673 | ||
* Added functionality to replicate in single threaded mode based on configuration without using a Queue by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/756 | ||
* Convert localDateTime to String in show_replica_status API call by @subkanthi in https://github.com/Altinity/clickhouse-sink-connector/pull/736 | ||
|
||
|
||
**Full Changelog**: https://github.com/Altinity/clickhouse-sink-connector/compare/2.2.1...2.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Start from the official Grafana image | ||
FROM grafana/grafana:latest | ||
USER root | ||
# Add your CA certificate to the system's trusted certificates | ||
# If you have multiple certificates, you can copy them all | ||
COPY ca-certificates.crt /usr/local/share/ca-certificates/ca-certificates.crt | ||
RUN apk add --no-cache ca-certificates && \ | ||
update-ca-certificates | ||
# Install the Grafana plugin | ||
# Replace 'your-plugin-id' with the actual plugin ID | ||
#RUN grafana-cli --pluginUrl https://your-plugin-repository.com/plugins/your-plugin-id install your-plugin-id | ||
|
||
# Restart Grafana to pick up the changes | ||
CMD ["/run.sh"] |
Oops, something went wrong.