You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anecdotally what we have noticed is that restarting START_REPLICATION for each SyncFlow or even having multiple sync flows isn't ideal. We should always be reading from the slot if at all possible. There are a couple of approaches that come to my mind:
Option 1: ACK channel
One of the main reasons we have multiple sync flows is that after each syncflow we update the metadata on the destination marking the last committed source LSN, this makes it durable for us to restart sync flows from this point, and to them flush this via standby message. We do this once per batch.
One alternative approach could be to:
once the destination gets max_batch_size number of rows, we update the metadata.
send the committed lsn to the PullRecords via a channel, and issue a flush.
we just have 1 sync flow this way.
Option 2: Landing Zone
This is a more drastic shift in how we currently do things. Have some kind of a durable store (maybe kafka or redpanda). Always read from the slot and push it to this landing zone. This way the slot is always being read from. Periodically push from the landing zone to the destination. This idea needs to be fleshed out in more detail.
Just make sure that START_REPLICATION doesn't incur a long running transaction and blocks autovaccum. I am not sure if START_REPLICATION is like a regular postgres transaction.
Anecdotally what we have noticed is that restarting
START_REPLICATION
for eachSyncFlow
or even having multiple sync flows isn't ideal. We should always be reading from the slot if at all possible. There are a couple of approaches that come to my mind:Option 1: ACK channel
One of the main reasons we have multiple sync flows is that after each syncflow we update the metadata on the destination marking the last committed source LSN, this makes it durable for us to restart sync flows from this point, and to them flush this via standby message. We do this once per batch.
One alternative approach could be to:
max_batch_size
number of rows, we update the metadata.PullRecords
via a channel, and issue a flush.Option 2: Landing Zone
This is a more drastic shift in how we currently do things. Have some kind of a durable store (maybe kafka or redpanda). Always read from the slot and push it to this landing zone. This way the slot is always being read from. Periodically push from the landing zone to the destination. This idea needs to be fleshed out in more detail.
@serprex for thoughts.
cc: @saisrirampur
The text was updated successfully, but these errors were encountered: