Unexpected message truncation in WaitForAllTransactionsToFinish - Mailing list pgsql-hackers

From cca5507
Subject Unexpected message truncation in WaitForAllTransactionsToFinish
Date
Msg-id tencent_47CA9CE2F91FF4D81D875E162AD69AA4900A@qq.com
Whole thread
List 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

pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Add per-backend lock statistics
Next
From: "cca5507"
Date:
Subject: Re: Fix tuple deformation with virtual generated NOT NULL columns