Rohit Gupta
Rohit Gupta

Reputation: 1

How can I set LSN number in AWS devezium to start event logs after a LSN

How can I set LSN number in AWS devezium to start event logs after a LSN, like I have 100 records in table Employee and after taking backup, I has those 100 records and restore that and now I start cdc using debezium and kafka using AWS MSk. and it should start get the records from 101 from employee table.

After taking backup I will have LSN number, but how can I configure that in debezium?

I got information of change LSN and commit LSN, but not sure if that can be the solution.

Upvotes: 0

Views: 54

Answers (1)

manjunath
manjunath

Reputation: 306

If you know the commit_lsn of 100th record try using below function. pg_replication_slot_advance(slot_name,move_to_lsn);

set move_to_lsn to commit_lsn of 100th record.

This function will basically advance the slot's confirmed_flush_lsn to specified position.

refer below docs https://pgpedia.info/p/pg_replication_slot_advance.html

CAUTION:-Before advancing the slot make sure that there are no other transactions in between current_confirmed_flush_lsn and commit_lsn of 100th record.Because after advancing you will loose them.

Upvotes: 0

Related Questions