Replication options

Hello Everyone,

I am trying to understand what available options to replicate routing database.
I tried to use pglogical postgresql 16 and PUBLICATION with SUBSCRIPTION and specify in sems config primary ans secondary node, but over some time like ( 20 min ) , postgresql start produce errors that missing relations.

Yeti-switch version 1.13

Here postgresql statement logs

myusername2@127.0.0.1``(46340):cdrprod [4182241] STATEMENT: SELECT pgq.next_batch(‘cdr_billing’, ‘cdr_billing’)
2026-03-23 15:18:42 UTC ``myusername2@127.0.0.1``(46340):cdrprod [4182241] ERROR: Not subscriber to queue: async_cdr_statistics/async_cdr_statistics
2026-03-23 15:18:42 UTC ``myusername2@127.0.0.1``(46340):cdrprod [4182241] CONTEXT: PL/pgSQL function pgq.next_batch_custom(text,text,interval,integer,interval) line 70 at RAISE
SQL statement “select f.batch_id, f.cur_tick_id, f.prev_tick_id,
f.cur_tick_time, f.prev_tick_time,
f.cur_tick_event_seq, f.prev_tick_event_seq
from pgq.next_batch_custom(i_queue_name, i_consumer_name, NULL, NULL, NULL) f”
PL/pgSQL function pgq.next_batch_info(text,text) line 33 at SQL statement
SQL statement “select batch_id from pgq.next_batch_info(i_queue_name, i_consumer_name)”
PL/pgSQL function pgq.next_batch(text,text) line 17 at SQL statement
PL/pgSQL function switch.async_cdr_statistics() line 8 at assignment
2026-03-23 15:18:42 UTC ``myusername2@127.0.0.1``(46340):cdrprod [4182241] STATEMENT: SELECT processed_records FROM switch.async_cdr_statistics()
2026-03-23 15:19:00 UTC ``myusername@127.0.0.1``(52400):myhostname [4181078] ERROR: relation “events” does not exist at character 22
2026-03-23 15:19:00 UTC ``myusername@127.0.0.1``(52400):myhostname [4181078] STATEMENT: SELECT COUNT() FROM “events”
2026-03-23 15:19:00 UTC ``myusername@127.0.0.1``(52400):myhostname [4181078] ERROR: relation “nodes” does not exist at character 23
2026-03-23 15:19:00 UTC ``myusername@127.0.0.1``(52400):myhostname [4181078] STATEMENT: SELECT “nodes”.
FROM “nodes”
2026-03-23 15:19:00 UTC ``myusername@127.0.0.1``(46338):myhostname [4182133] ERROR: relation “dialpeer_next_rates” does not exist at character 37
2026-03-23 15:19:00 UTC ``myusername@127.0.0.1``(46338):myhostname [4182133] STATEMENT: SELECT “dialpeer_next_rates”.* FROM “dialpeer_next_rates” WHERE “dialpeer_next_rates”.“applied” = $1 AND (apply_time < $2) ORDER BY “dialpeer_next_rates”.“id” ASC LIMIT $3

if you are using pglogical you have to synchronize schema yourself. Actually it is strange decision to use pglogical there.

For now I am just exploring the options.

If possible to know what is valid options and what possible to replicate?

there is built-in postgresql streaming replication.

OHHH, where are possible to some doc or how to enable and what.

Huge thank you, reading

Idea beihind logical replication for active/active ( both nodes write ) setup with upstream load balancer.

Yeti designed to provide call routing redundancy without logical replication.

Can you please explain a bit more ?

Can you please explain a bit more ?
On streaming replication getting in CDR db error

PG::RaiseException: ERROR: Not subscriber to queue: cdr_billing/cdr_billing

Looks like you trying to write data on readonly replica. Why?

You could use forum search and read Replication and Distributed setup

That on master, the issue when replication is running setup still produce a lot messages on missing SQL relations. I tried to drop databases and recreate, with database data restore.

I am testing disaster restore right now .

ok. Why there are missing SQL relations on your master?

Yes, on master. When I checked actual postgresql everything look ok, but yeti web sems are producing SQL statements errors. That seems some issue with schema.

I am not sure I can help you. It is not clear what you doing and what expecting. Any properly configured replication mechanism should not change database structure.

Let me try to clarify.
I am testing disaster recovery scenario a specially backup and restore of routing,cdr databases.
I am doing data only backup for routing database and for CDR normally only schema.

Questions raised so far.

  1. When restoring routing data I can’t use seed option, because it creates conflict on restore.
  2. I can’t find proper option to use under rake –tasks to setup CDR database only (seed the initial data) .
  3. When CDR schema restored , ticker pgqd quits on start with error.

For the pgqd error, check:

Databases Maintenance | Yeti Switch