Re: POC: Cleaning up orphaned files using undo logs

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: POC: Cleaning up orphaned files using undo logs
Date: 2019-05-09 06:34:16
Message-ID: CAFiTN-tnQAJ5-n4EVr=E6LRV6w0t7rnV_hsA8g2m9T0dUS6tyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 6, 2019 at 5:43 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> Just for tracking, open comments which still needs to be worked on.
>
> 1. Avoid special case in UndoRecordIsValid.
> > Can we instead eliminate the special case? It seems like the if
> > (log->oldest_data == InvalidUndoRecPtr) case will be taken very
> > rarely, so if it's buggy, we might not notice.

I have worked on this comments and added changes in the latest patch.
>
> 2. While updating the previous transaction header instead of unpacking
> complete header and writing it back, we can just unpack main header
> and calculate the offset of uur_next and then update it directly.

For this as you suggested I am not changing, updated the comments.
>
> 3. unifying uur_xid and uur_xidepoch into uur_fxid.
Still open.

I have also added the README.

Patches can be applied on top of undo branch [1] commit:
(cb777466d008e656f03771cf16ec7ef9d6f2778b)

[1] https://github.com/EnterpriseDB/zheap/tree/undo

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
0001-Update-oldest_data-on-startup_v5.patch application/octet-stream 817 bytes
0003-Test-module-for-undo-api_v5.patch application/octet-stream 9.1 KB
0004-undo-page-consistency-checker_v5.patch application/octet-stream 10.9 KB
0002-Provide-interfaces-to-store-and-fetch-undo-records_v5.patch application/octet-stream 83.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2019-05-09 06:42:28 Re: integrate Postgres Users Authentication with our own LDAP Server
Previous Message Kyotaro HORIGUCHI 2019-05-09 06:28:36 Re: Unexpected "shared memory block is still in use"