Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound
Date: 2023-01-16 12:50:57
Message-ID: CAJ7c6TOi1mY4ZKC03cC+r038yJLqYFPkJWLqr+cSE4OTBsp7wQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

> The proposed patchset changes the documentation and the error messages
> accordingly, making them less misleading. 0001 corrects the
> documentation but doesn't touch the code. 0002 and 0003 correct the
> messages shown when approaching xidWrapLimit and xidWarnLimit
> accordingly.

A colleague of mine, Oleksii Kliukin, pointed out that the
recommendation about running VACUUM in a single-user mode is also
outdated, as it was previously reported in [1]. I didn't believe it at
first and decided to double-check:

```
=# select * from phonebook;
id | name | phone
----+---------+-------
1 | Alex | 123
5 | Charlie | 789
2 | Bob | 456
6 | Ololo | 789
(4 rows)

=# insert into phonebook values (7, 'Trololo', 987);
ERROR: database is not accepting commands to avoid wraparound data
loss in database "template1"
HINT: Stop the postmaster and vacuum that database in single-user mode.
You might also need to commit or roll back old prepared transactions,
or drop stale replication slots.

=# VACUUM FREEZE;
VACUUM

=# insert into phonebook values (7, 'Trololo', 987);
INSERT 0 1

=# SELECT current_setting('wal_level');
current_setting
-----------------
logical
```

Unfortunately the [1] discussion went nowhere. So I figured it would
be appropriate to add corresponding changes to the proposed patchset
since it's relevant and is registered in the CF app already. PFA
patchset v2 which now also includes 0004.

[1]: https://www.postgresql.org/message-id/flat/CAMT0RQTmRj_Egtmre6fbiMA9E2hM3BsLULiV8W00stwa3URvzA%40mail.gmail.com

--
Best regards,
Aleksander Alekseev

Attachment Content-Type Size
v2-0001-Correct-the-docs-about-preventing-XID-wraparound.patch application/octet-stream 3.1 KB
v2-0003-Fix-the-message-in-case-of-exceeding-xidWarnLimit.patch application/octet-stream 3.8 KB
v2-0004-Don-t-recommend-running-VACUUM-in-a-single-user-m.patch application/octet-stream 3.8 KB
v2-0002-Fix-the-message-in-case-of-approaching-xidWrapLim.patch application/octet-stream 2.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Xing Guo 2023-01-16 13:03:43 Re: PL/Python: Fix return in the middle of PG_TRY() block.
Previous Message torikoshia 2023-01-16 12:36:59 Record queryid when auto_explain.log_verbose is on