RE: Locking B-tree leafs immediately in exclusive mode - Mailing list pgsql-hackers

From Imai, Yoshikazu
Subject RE: Locking B-tree leafs immediately in exclusive mode
Date
Msg-id 0F97FA9ABBDBE54F91744A9B37151A5118EC3F@g01jpexmbkw24
Whole thread Raw
In response to RE: Locking B-tree leafs immediately in exclusive mode  ("Imai, Yoshikazu" <imai.yoshikazu@jp.fujitsu.com>)
Responses Re: Locking B-tree leafs immediately in exclusive mode
List pgsql-hackers
On Mon, July 9, 2018 at 3:19 AM, Imai, Yoshikazu wrote:
> I'm planning to do code review and send it in the next mail.

Sorry for delaying the code review.

I did the code review, and I think there are no logical wrongs
with B-Tree.

I tested integrity of B-Tree with amcheck just in case.
I execute this test on 16-cores machine with 64GB mem.

I run B-Tree insertion and deletion simultaneously and execute 
'bt_index_parent_check' periodically.
I also run B-Tree insertion and update simultaneously and execute
'bt_index_parent_check' periodically.

##  DDL
create table mytab (val1 int, val2 int);
create index mytabidx on mytab (val1, val2);

## script_integrity_check_insert.sql
\set i random(1, 100)
\set j random(1, 100)
insert into mytab values (:i, :j);

## script_integrity_check_delete.sql
\set i random(1, 100)
\set j random(1, 100)
delete from mytab where val1 = :i and val2 = :j

## script_integrity_check_update.sql
\set i random(1, 100)
\set j random(1, 100)
\set k random(1, 100)
\set l random(1, 100)
update mytab set val1 = :k, val2 = :l where val1 = :i and val2 = :j

## commands(insert, delete, simultaneously executed)
pgbench -T 60 -P 1 -M prepared -f script_integrity_check_insert.sql -c 2 postgres
pgbench -T 60 -P 1 -M prepared -f script_integrity_check_delete.sql -c 2 postgres

## commands(insert, update, simultaneously executed)
pgbench -T 60 -P 1 -M prepared -f script_integrity_check_insert.sql -c 2 postgres
pgbench -T 60 -P 1 -M prepared -f script_integrity_check_update.sql -c 2 postgres

## commands(executed during above insert, delete, update)
(psql) select bt_index_parent_check('mytabidx');


Finally, I confirmed there are no integrity problems during B-Tree operation.

Lefted tasks in my review is doing the regression tests.


Yoshikazu Imai


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: LLVM jit and matview
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] plpgsql - additional extra checks