On Wed, Apr 2, 2025 at 2:06 PM Bertrand Drouvot <bertranddrouvot...@gmail.com> wrote: > > > As far PG17-v4-0001: > > > === 4 > > It looks like that check_slots_conflict_reason() is not called with > checks_active_slot > as argument. > > === 5 > > I think that we could remove the need for the drop_active_slot parameter in > drop_logical_slots() and just check if an active slot exists (and if so drop > it). That said I'm not sure it's worth to go that far for backpatching. >
The other idea to simplify the changes for backbranches: sub reactive_slots_change_hfs_and_wait_for_xmins { ... + my ($slot_prefix, $hsf, $invalidated, $needs_active_slot) = @_; # create the logical slots - create_logical_slots($node_standby, $slot_prefix); + create_logical_slots($node_standby, $slot_prefix, $needs_active_slot); ... + if ($needs_active_slot) + { + $handle = + make_slot_active($node_standby, $slot_prefix, 1, \$stdout, \$stderr); + } What if this function doesn't take input parameter needs_active_slot and rather removes the call to make_slot_active? We will call make_slot_active only at the required places. This should make the changes much less because after that, we don't need to make changes related to drop and create. Sure, in some cases, we will test two inactive slots instead of one, but I guess that would be the price to keep the tests simple and more like HEAD. -- With Regards, Amit Kapila.