Re: fixing old_snapshot_threshold's time->xid mapping

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: fixing old_snapshot_threshold's time->xid mapping
Дата
Msg-id CA+TgmoZsiQ_6BLNN4LMVYV21GoaQmF=T3Qxjd=4EC_WkEL2b_Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: fixing old_snapshot_threshold's time->xid mapping  (Dilip Kumar <dilipbalaut@gmail.com>)
Ответы Re: fixing old_snapshot_threshold's time->xid mapping  (Dilip Kumar <dilipbalaut@gmail.com>)
Список pgsql-hackers
On Mon, Apr 20, 2020 at 12:10 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> I have started reviewing these patches.  I think, the fixes looks right to me.
>
> + LWLockAcquire(OldSnapshotTimeMapLock, LW_SHARED);
> + mapping->head_offset = oldSnapshotControl->head_offset;
> + mapping->head_timestamp = oldSnapshotControl->head_timestamp;
> + mapping->count_used = oldSnapshotControl->count_used;
> + for (int i = 0; i < OLD_SNAPSHOT_TIME_MAP_ENTRIES; ++i)
> + mapping->xid_by_minute[i] = oldSnapshotControl->xid_by_minute[i];
> + LWLockRelease(OldSnapshotTimeMapLock);
>
> I think memcpy would be a better choice instead of looping it for all
> the entries, since we are doing this under a lock?

When I did it that way, it complained about "const" and I couldn't
immediately figure out how to fix it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Mark Dilger
Дата:
Сообщение: new heapcheck contrib module
Следующее
От: Robert Haas
Дата:
Сообщение: Re: design for parallel backup