mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Check slot->restart_lsn validity in a few more places
Lack of these checks could cause visible misbehavior, including
assertion failures. This was missed in commit c655077639
, whereby
restart_lsn becomes invalid when the size limit is exceeded.
Also reword some existing error messages, and add errdetail(), so that
the reported errors all match in spirit.
Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/20200408.093710.447591748588426656.horikyota.ntt@gmail.com
This commit is contained in:
@@ -598,7 +598,9 @@ pg_replication_slot_advance(PG_FUNCTION_ARGS)
|
||||
if (XLogRecPtrIsInvalid(MyReplicationSlot->data.restart_lsn))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("cannot advance replication slot that has not previously reserved WAL")));
|
||||
errmsg("replication slot \"%s\" cannot be advanced",
|
||||
NameStr(*slotname)),
|
||||
errdetail("This slot has never previously reserved WAL, or has been invalidated.")));
|
||||
|
||||
/*
|
||||
* Check if the slot is not moving backwards. Physical slots rely simply
|
||||
|
Reference in New Issue
Block a user