Temporary CDC buffering while intial data snapshot is running
Before the initial data snapshot is running we need to send a signal to the logical replication thread to alter its behavior.
- The initial data snapshot thread starts.
- Before exporting the snapshot, we notify the logical replication thread with the name of the table.
- The logical replication thread for that given table will start buffering logical replication events in a temporary buffer.
- When the initial data snapshot thread is finished, notify the logical replication thread again with the table name.
- At this point the initial data snapshot is already in the "queue", we can now copy the temporary buffer created for the logical replication to the queue.
- Start consuming logical replication data for the table without the buffer.