mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Improve log messages and docs for slot synchronization.
Improve the clarity of LOG messages when a failover logical slot synchronization fails, making the reasons more explicit for easier debugging. Update the documentation to outline scenarios where slot synchronization can fail, especially during the initial sync, and emphasize that pg_sync_replication_slot() is primarily intended for testing and debugging purposes. We also discussed improving the functionality of pg_sync_replication_slot() so that it can be used reliably, but we would take up that work for next version after some more discussion and review. Reported-by: Suraj Kharage <suraj.kharage@enterprisedb.com> Author: shveta malik <shveta.malik@gmail.com> Reviewed-by: Zhijie Hou <houzj.fnst@fujitsu.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Backpatch-through: 17, where it was introduced Discussion: https://postgr.es/m/CAF1DzPWTcg+m+x+oVVB=y4q9=PYYsL_mujVp7uJr-_oUtWNGbA@mail.gmail.com
This commit is contained in:
@ -211,9 +211,9 @@ update_local_synced_slot(RemoteSlot *remote_slot, Oid remote_dbid,
|
||||
* impact the users, so we used DEBUG1 level to log the message.
|
||||
*/
|
||||
ereport(slot->data.persistency == RS_TEMPORARY ? LOG : DEBUG1,
|
||||
errmsg("could not synchronize replication slot \"%s\" because remote slot precedes local slot",
|
||||
errmsg("could not synchronize replication slot \"%s\"",
|
||||
remote_slot->name),
|
||||
errdetail("The remote slot has LSN %X/%X and catalog xmin %u, but the local slot has LSN %X/%X and catalog xmin %u.",
|
||||
errdetail("Synchronization could lead to data loss as the remote slot needs WAL at LSN %X/%X and catalog xmin %u, but the standby has LSN %X/%X and catalog xmin %u.",
|
||||
LSN_FORMAT_ARGS(remote_slot->restart_lsn),
|
||||
remote_slot->catalog_xmin,
|
||||
LSN_FORMAT_ARGS(slot->data.restart_lsn),
|
||||
@ -593,7 +593,7 @@ update_and_persist_local_synced_slot(RemoteSlot *remote_slot, Oid remote_dbid)
|
||||
{
|
||||
ereport(LOG,
|
||||
errmsg("could not synchronize replication slot \"%s\"", remote_slot->name),
|
||||
errdetail("Logical decoding could not find consistent point from local slot's LSN %X/%X.",
|
||||
errdetail("Synchronization could lead to data loss as standby could not build a consistent snapshot to decode WALs at LSN %X/%X.",
|
||||
LSN_FORMAT_ARGS(slot->data.restart_lsn)));
|
||||
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user