Re: [PATCH] XLogReadRecord returns pointer to currently read page
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: a.lepikhov@postgrespro.ru, hlinnaka@iki.fi, pgsql-hackers@postgresql.org
Date: 2018-11-16T06:23:55Z
Lists: pgsql-hackers
On Thu, Nov 15, 2018 at 06:12:38PM +0900, Kyotaro HORIGUCHI wrote: > This patch eliminates unnecessary copying that was done for > non-continued records. Now the return value of XLogReadRecord > directly points into page buffer holded in XLogReaderStats. It is > safe because no caller site uses the returned pointer beyond the > replacement of buffer content at the next call to the same > function. I was looking at this patch, and shouldn't we worry about compatibility with plugins or utilities which look directly at what's in readRecordBuf for the record contents? Let's not forget that the contents of XLogReaderState are public. -- Michael
Commits
-
Improve description of buffer used to store records in WAL reader
- 0999ac479292 12.0 landed
-
Remove unnecessary memcpy when reading WAL record fitting on page
- 285bd0ac4a7c 12.0 landed