Unexpected message truncation in WaitForAllTransactionsToFinish

From: cca5507 <cca5507(at)qq(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, daniel <daniel(at)yesql(dot)se>
Subject: Unexpected message truncation in WaitForAllTransactionsToFinish
Date: 2026-06-05 08:30:51
Message-ID: tencent_47CA9CE2F91FF4D81D875E162AD69AA4900A@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

In WaitForAllTransactionsToFinish():

```
char activity[64];
int rc;

/* Oldest running xid is older than us, so wait */
snprintf(activity,
sizeof(activity),
"Waiting for current transactions to finish (waiting for %u)",
waitforxid);
pgstat_report_activity(STATE_RUNNING, activity);
```

The buffer is not big enough to hold the message if the 'waitforxid' is too big.

How about changing the message to this:

"Waiting for transactions older than %u to finish"

--
Regards,
ChangAo Chen

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message cca5507 2026-06-05 08:52:46 Re: Fix tuple deformation with virtual generated NOT NULL columns
Previous Message Bertrand Drouvot 2026-06-05 08:29:12 Re: Add per-backend lock statistics