On Friday, February 9, 2024 4:13 PM Peter Smith <smithpb2250@gmail.com> wrote:
>
> FYI -- I checked patch v81-0001 to find which of the #includes are strictly needed.
Thanks!
>
> 1.
> ...
>
> Many of these #includes seem unnecessary. e.g. I was able to remove
> all those that are commented-out below, and the file still compiles OK
> with no warnings:
Removed.
>
>
> ======
> src/backend/replication/slot.c
>
>
>
> 2.
> #include "pgstat.h"
> +#include "replication/slotsync.h"
> #include "replication/slot.h"
> +#include "replication/walsender.h"
> #include "storage/fd.h"
>
> The #include "replication/walsender.h" seems to be unnecessary.
Removed.
>
> ======
> src/backend/replication/walsender.c
>
> 3.
> #include "replication/logical.h"
> +#include "replication/slotsync.h"
> #include "replication/slot.h"
>
> The #include "replication/slotsync.h" is needed, but only for Assert code:
> Assert(am_cascading_walsender || IsSyncingReplicationSlots());
>
> So you could #ifdef around that #include if you wish to.
I am not sure if it's necessary and didn't find similar coding, so
didn't change.
Best Regards,
Hou zj