Re: GIN non-intrusive vacuum of posting tree

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andrey Borodin <amborodin(at)acm(dot)org>
Cc: Vladimir Borodin <root(at)simply(dot)name>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Евгений Ефимкин <efimkin(at)yandex-team(dot)ru>, Teodor Sigaev <teodor(at)postgrespro(dot)ru>
Subject: Re: GIN non-intrusive vacuum of posting tree
Date: 2016-12-02 15:20:50
Message-ID: CA+TgmoaU6=+F1wpjO7gqi-kOLTACO9XrfSOzXxaO7cOAnE3xGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 30, 2016 at 11:38 AM, Andrew Borodin <borodin(at)octonica(dot)com> wrote:
> This scan acquires cleanup lock on root of scan (not necessarily root
> of posting tree). Cleanup lock ensures no inserts are inside subtree.
> Scan traverses subtree DF taking exclusive locks from left to right.
> For any page being deleted all leftmost pages were locked and unlocked
> before. New reads cannot enter subtree, all old readscans were
> excluded by lock\unlock. Thus there shall not be deadlocks with
> ginStepRight().
>
> We get lock on page being deleted, then on a left page.
> ginStepRight() takes lock on left page, than on right page. But it’s
> presence is excluded by cleanup lock and DFS scan with locks of upper
> and left parts of tree.
>
> Thank you for reading this. Concurrency bothers me a lot. If you see
> that anything is wrong or suspicious, please do not hesitate to post
> your thoughts.

I don't know much about GIN, but this seems like an interesting
improvement. I hope somebody who knows more about GIN will step up to
review it in depth.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-12-02 15:24:30 Re: Patch: Implement failover on libpq connect level.
Previous Message Rahila Syed 2016-12-02 14:54:28 Re: Improvements in psql hooks for variables