Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove usage for pg-primary-dsn #213

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions devtools/htap-setup-pg/pgpool2/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ services:
container_name: htap-pg-setup
command: >
sh -c "
PGPASSWORD=postgres psql -h pgsql -p 5432 -U postgres -d postgres -c \"CREATE PUBLICATION myduck_subscription FOR ALL TABLES;\" &&
PGPASSWORD=postgres psql -h pgsql -p 5432 -U postgres -d postgres -c \"SELECT PG_CREATE_LOGICAL_REPLICATION_SLOT('myduck_subscription', 'pgoutput');\" &&
PGPASSWORD=postgres psql -h pgsql -p 5432 -U postgres -d postgres -c \"CREATE TABLE test (id INT PRIMARY KEY, name VARCHAR(255));\" &&
PGPASSWORD=postgres psql -h pgsql -p 5432 -U postgres -d postgres -c \"INSERT INTO test (id, name) VALUES (1, 'test');\"
"
Expand All @@ -37,8 +35,8 @@ services:
pull_policy: always
container_name: htap-myduck
environment:
PGSQL_PRIMARY_DSN: postgres://postgres:postgres@pgsql:5432/postgres?sslmode=disable
PGSQL_SLOT_NAME: myduck_subscription
SETUP_MODE: REPLICA
SOURCE_DSN: postgres://postgres:postgres@pgsql:5432/postgres
depends_on:
pgsql:
condition: service_healthy
Expand Down
9 changes: 1 addition & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ var (

replicaOptions replica.ReplicaOptions

postgresPort = 5432
postgresPrimaryDsn string
postgresSlotName = "myduck"
postgresPort = 5432
)

func init() {
Expand All @@ -77,8 +75,6 @@ func init() {
// The following options are used to configure the Postgres server.

flag.IntVar(&postgresPort, "pg-port", postgresPort, "The port to bind to for PostgreSQL wire protocol.")
flag.StringVar(&postgresPrimaryDsn, "pg-primary-dsn", postgresPrimaryDsn, "The DSN of the primary server for logical replication.")
flag.StringVar(&postgresSlotName, "pg-slot-name", postgresSlotName, "The name of the logical replication slot to use.")
}

func ensureSQLTranslate() {
Expand Down Expand Up @@ -152,9 +148,6 @@ func main() {
if err != nil {
logrus.WithError(err).Fatalln("Failed to create Postgres-protocol server")
}
if postgresPrimaryDsn != "" && postgresSlotName != "" {
go pgServer.StartReplication(postgresPrimaryDsn, postgresSlotName)
}
go pgServer.Start()
}

Expand Down
Loading