Re: Avoid updating inactive_since for invalid replication slots

2025-02-06 Thread Peter Smith
On Wed, Feb 5, 2025 at 2:29 PM Amit Kapila wrote: > > On Wed, Feb 5, 2025 at 5:53 AM Peter Smith wrote: > > > > Some review comments for v2-0001. > > > > == > > doc/src/sgml/system-views.sgml > > > > 1. > > The time when the slot became inactive. NULL if the slot is currently > > being stream

Re: Avoid updating inactive_since for invalid replication slots

2025-02-04 Thread Amit Kapila
On Wed, Feb 5, 2025 at 5:53 AM Peter Smith wrote: > > Some review comments for v2-0001. > > == > doc/src/sgml/system-views.sgml > > 1. > The time when the slot became inactive. NULL if the slot is currently > being streamed. If the slot becomes invalid, this value will never be > updated. Note

Re: Avoid updating inactive_since for invalid replication slots

2025-02-04 Thread Peter Smith
Hi Nisha, Some review comments for v2-0001. == doc/src/sgml/system-views.sgml 1. The time when the slot became inactive. NULL if the slot is currently being streamed. If the slot becomes invalid, this value will never be updated. Note that for slots on the standby that are being synced from

Re: Avoid updating inactive_since for invalid replication slots

2025-02-03 Thread Amit Kapila
On Tue, Feb 4, 2025 at 12:05 PM vignesh C wrote: > > On Tue, 4 Feb 2025 at 11:52, Nisha Moond wrote: > > > > Here is the v2 patch with above change and other comments from [1] and > > [2] incorporated. > > One small suggestion: > Since we will not be retaining inactive time for invalid slots afte

Re: Avoid updating inactive_since for invalid replication slots

2025-02-03 Thread vignesh C
On Tue, 4 Feb 2025 at 11:52, Nisha Moond wrote: > > Here is the v2 patch with above change and other comments from [1] and > [2] incorporated. One small suggestion: Since we will not be retaining inactive time for invalid slots after server restart, the inactive time will be lost in this case, sh

Re: Avoid updating inactive_since for invalid replication slots

2025-02-03 Thread Nisha Moond
On Tue, Feb 4, 2025 at 9:33 AM Zhijie Hou (Fujitsu) wrote: > > On Monday, February 3, 2025 8:03 PM Nisha Moond > wrote: > > > > Hi Hackers, > > (CC people involved in the earlier discussion) > > > > Right now, it is possible for the 'inactive_since' value of an invalid > > replication > > slot

RE: Avoid updating inactive_since for invalid replication slots

2025-02-03 Thread Zhijie Hou (Fujitsu)
On Monday, February 3, 2025 8:03 PM Nisha Moond wrote: > > Hi Hackers, > (CC people involved in the earlier discussion) > > Right now, it is possible for the 'inactive_since' value of an invalid > replication > slot to be updated multiple times, which is unexpected behavior. > As suggested in

Re: Avoid updating inactive_since for invalid replication slots

2025-02-03 Thread Amit Kapila
On Tue, Feb 4, 2025 at 8:37 AM Peter Smith wrote: > > Some review comments for patch v1-0001 > > == > GENERAL - Missing Test case? > > 1. > Should there be some before/after test case for 'active_since' value > with invalid slots to verify that the patch is doing what it says? > I think the e

Re: Avoid updating inactive_since for invalid replication slots

2025-02-03 Thread Peter Smith
Hi Nisha. Some review comments for patch v1-0001 == GENERAL - Missing Test case? 1. Should there be some before/after test case for 'active_since' value with invalid slots to verify that the patch is doing what it says? == src/backend/replication/slot.c ReplicationSlotAcquire: 2. I sa