Re: pg_upgrade and rsync

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: pg_upgrade and rsync
Дата
Msg-id 54C16225.2070507@vmware.com
обсуждение исходный текст
Ответ на Re: pg_upgrade and rsync  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: pg_upgrade and rsync  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On 01/22/2015 10:34 PM, Jim Nasby wrote:
> On 1/22/15 2:19 PM, Heikki Linnakangas wrote:
>> On 01/22/2015 09:20 PM, Bruce Momjian wrote:
>>> One question I have is whether hint bits are set by read-only
>>> transactions on standby servers.
>>
>> No. See comments in MarkBufferDirtyHint:
>>
>>>          /*
>>>           * If we need to protect hint bit updates from torn writes, WAL-log a
>>>           * full page image of the page. This full page image is only necessary
>>>           * if the hint bit update is the first change to the page since the
>>>           * last checkpoint.
>>>           *
>>>           * We don't check full_page_writes here because that logic is included
>>>           * when we call XLogInsert() since the value changes dynamically.
>>>           */
>>>          if (XLogHintBitIsNeeded() && (bufHdr->flags & BM_PERMANENT))
>>>          {
>>>              /*
>>>               * If we're in recovery we cannot dirty a page because of a hint.
>>>               * We can set the hint, just not dirty the page as a result so the
>>>               * hint is lost when we evict the page or shutdown.
>>>               *
>>>               * See src/backend/storage/page/README for longer discussion.
>>>               */
>>>              if (RecoveryInProgress())
>>>                  return;
>
> What if XLogHintBitIsNeeded is false? That would be the case if we're not wall logging hints *on the standby*.

Then the page will be updated without writing a WAL record. Just like in 
the master, if wal_log_hints is off. wal_log_hints works the same on the 
master or the standby.

- Heikki



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: basebackups during ALTER DATABASE ... SET TABLESPACE ... not safe?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: basebackups during ALTER DATABASE ... SET TABLESPACE ... not safe?