6) I tried to test the patch. When sequences are more than the batch-size, but not enough to make a complete batch of max size, I get this error:
LOG: logical replication sequence synchronization for subscription "sub1" - total unsynchronized: 118 LOG: logical replication sequence synchronization for subscription "sub1" - batch #1 = 100 attempted, 100 succeeded, 0 skipped, 0 mismatched, 0 insufficient pemission, 0 missing, WARNING: leaked hash_seq_search scan for hash table 0x5fcc78ff8f90 ERROR: no hash_seq_search scan for hash table "Logical replication sequence sync worker sequences" LOG: background worker "logical replication sequencesync worker" (PID 137165) exited with exit code 1 This is on creating 118 sequences. It can be easily reproduced by reducing bath-size (MAX_SEQUENCES_SYNC_PER_BATCH) to say 5 and having 6 sequences in total. It seems we break out of the loop of creating a batch only if batch_size >= MAX_SEQUENCES_SYNC_PER_BATCH. When we try to access hash_seq_search() more than the entries present, it gives the above error. thanks Shveta
