Re: Introduce XID age and inactive timeout based replication slot invalidation
От
Ajin Cherian
Тема
Re: Introduce XID age and inactive timeout based replication slot invalidation
Дата
Msg-id
CAFPTHDadSTwPStFyTLOwKzxtsdRn02CSHK+ZLkWR7rHDf3QY9Q@mail.gmail.com
Ответ на
Re: Introduce XID age and inactive timeout based replication slot invalidation (Bharath Rupireddy)
Список
Дерево обсуждения
Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Dilip Kumar <dilipbalaut@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Nathan Bossart <nathandbossart@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Nathan Bossart <nathandbossart@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Nathan Bossart <nathandbossart@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Michael Paquier <michael@paquier.xyz>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Nathan Bossart <nathandbossart@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Ajin Cherian <itsajin@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Nathan Bossart <nathandbossart@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Ajin Cherian <itsajin@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Nathan Bossart <nathandbossart@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation shveta malik <shveta.malik@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Amit Kapila <amit.kapila16@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: Introduce XID age and inactive timeout based replication slot invalidation Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
On Tue, Mar 26, 2024 at 7:57 PM Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote:
Please see the attached v23 patches. I've addressed all the review
comments received so far from Amit and Shveta.
In patch 0003:
+ SpinLockAcquire(&slot->mutex);
+ }
+
+ Assert(LWLockHeldByMeInMode(ReplicationSlotControlLock, LW_SHARED));
+
+ if (slot->inactive_since > 0 &&
+ slot->data.inactive_timeout > 0)
+ {
+ TimestampTz now;
+
+ /* inactive_since is only tracked for inactive slots */
+ Assert(slot->active_pid == 0);
+
+ now = GetCurrentTimestamp();
+ if (TimestampDifferenceExceeds(slot->inactive_since, now,
+ slot->data.inactive_timeout * 1000))
+ inavidation_cause = RS_INVAL_INACTIVE_TIMEOUT;
+ }
+
+ if (need_locks)
+ {
+ SpinLockRelease(&slot->mutex);
+ SpinLockAcquire(&slot->mutex);
+ }
+
+ Assert(LWLockHeldByMeInMode(ReplicationSlotControlLock, LW_SHARED));
+
+ if (slot->inactive_since > 0 &&
+ slot->data.inactive_timeout > 0)
+ {
+ TimestampTz now;
+
+ /* inactive_since is only tracked for inactive slots */
+ Assert(slot->active_pid == 0);
+
+ now = GetCurrentTimestamp();
+ if (TimestampDifferenceExceeds(slot->inactive_since, now,
+ slot->data.inactive_timeout * 1000))
+ inavidation_cause = RS_INVAL_INACTIVE_TIMEOUT;
+ }
+
+ if (need_locks)
+ {
+ SpinLockRelease(&slot->mutex);
Here, GetCurrentTimestamp() is still called with SpinLock held. Maybe do this prior to acquiring the spinlock.
regards,
Ajin Cherian
Fujitsu Australia
В списке pgsql-hackers по дате отправления
От: Amit Kapila
Дата:
От: shveta malik
Дата: