On 24.04.23 14:03, Hayato Kuroda (Fujitsu) wrote:
>> so at least there's a good chance that they will still be at
>> shutdown, and will therefore send all the data to the subscribers? Having a
>> regression tests for that scenario would also be a good idea. Having an
>> uncommitted write transaction should be enough to cover it.
>
> I think background_psql() can be used for the purpose. Before doing pg_upgrade
> --check, a transaction is opened and kept. It means that the confirmed_flush has
> been not reached to the current WAL position yet, but the checking says OK
> because all slots are active.
A suggestion: You could write some/most tests against test_decoding
rather than the publication/subscription system. That way, you can
avoid many timing issues in the tests and you can check more exactly
that the slots produce the output you want. This would also help ensure
that this new facility works for other logical decoding output plugins
besides the built-in one.