You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Raise an error while trying to acquire an invalid slot.
Once a replication slot is invalidated, it cannot be altered or used tofetch changes. However, a process could still acquire an invalid slot andfail later.For example, if a process acquires a logical slot that was invalidated dueto wal_removed, it will eventually fail in CreateDecodingContext() whenattempting to access the removed WAL. Similarly, for physical replicationslots, even if the slot is invalidated and invalidation_reason is set towal_removed, the walsender does not currently check for invalidation whenstarting physical replication. Instead, replication starts, and an erroris only reported later while trying to access WAL. Similarly, we prohibitmodifying slot properties for invalid slots but give the error for thesame after acquiring the slot.This patch improves error handling by detecting invalid slots earlier atthe time of slot acquisition which is the first step. This also helped inunifying different ERROR messages at different places and gave aconsistent message for invalid slots. This means that the message forinvalid slots will change to a generic message.This will also be helpful for future patches where we are planning toinvalidate slots due to more reasons like idle_timeout because we don'thave to modify multiple places in such cases and avoid the chances ofmissing out on a particular place.Author: Nisha Moond <nisha.moond412@gmail.com>Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>Reviewed-by: Vignesh C <vignesh21@gmail.com>Reviewed-by: Peter Smith <smithpb2250@gmail.com>Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>Discussion:https://postgr.es/m/CABdArM6pBL5hPnSQ+5nEVMANcF4FCH7LQmgskXyiLY75TMnKpw@mail.gmail.com