Re: [HACKERS] Microvacuum support for Hash Index

Поиск
Список
Период
Сортировка
От Ashutosh Sharma
Тема Re: [HACKERS] Microvacuum support for Hash Index
Дата
Msg-id CAE9k0Pna0wZ030iYzwkSpHNZW8-JdjZmip7i-477kVs7TVz8EA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Microvacuum support for Hash Index  (Jesper Pedersen <jesper.pedersen@redhat.com>)
Ответы Re: [HACKERS] Microvacuum support for Hash Index  (Jesper Pedersen <jesper.pedersen@redhat.com>)
Список pgsql-hackers
Hi Jesper,

> However (master / WAL v7 / MV v4),
>
> --- ddl.sql ---
> CREATE TABLE test AS SELECT generate_series(1, 10) AS id, 0 AS val;
> CREATE INDEX IF NOT EXISTS idx_id ON test USING hash (id);
> CREATE INDEX IF NOT EXISTS idx_val ON test USING hash (val);
> ANALYZE;
> --- ddl.sql ---
>
> --- test.sql ---
> \set id random(1,10)
> \set val random(0,10)
> BEGIN;
> DELETE FROM test WHERE id = :id;
> INSERT INTO test VALUES (:id, :val);
> COMMIT;
> --- test.sql ---
>
> gives
>
> #9  0x000000000098a83e in elog_finish (elevel=20, fmt=0xb6ea92 "incorrect
> local pin count: %d") at elog.c:1378
> #10 0x00000000007f0b33 in LockBufferForCleanup (buffer=1677) at
> bufmgr.c:3605
> #11 0x0000000000549390 in XLogReadBufferForRedoExtended (record=0x2afced8,
> block_id=1 '\001', mode=RBM_NORMAL, get_cleanup_lock=1 '\001',
> buf=0x7ffe3ee27c8c) at xlogutils.c:394
> #12 0x00000000004c5026 in hash_xlog_vacuum_one_page (record=0x2afced8) at
> hash_xlog.c:1109
> #13 0x00000000004c5547 in hash_redo (record=0x2afced8) at hash_xlog.c:1214
> #14 0x000000000053a361 in StartupXLOG () at xlog.c:6975
> #15 0x00000000007a4ca0 in StartupProcessMain () at startup.c:216
>
> on the slave instance in a master-slave setup.

Thanks for reporting this problem. It is basically coming because i
forgot to unpin the bucketbuf in hash_xlog_vacuum_one_page(). Please
find the attached v5 patch that fixes the issue.

>
> Also, the src/backend/access/README file should be updated with a
> description of the changes which this patch provides.

okay, I have updated the insertion algorithm in the README file.

--
With Regards,
Ashutosh Sharma
EnterpriseDB: http://www.enterprisedb.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Andrew Borodin
Дата:
Сообщение: Re: [HACKERS] GSoC 2017
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: [HACKERS] proposal: session server side variables