public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nikita Malakhov <[email protected]>
To: Robert Haas <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Greg Stark <[email protected]>
Cc: Teodor Sigaev <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Pluggable toaster
Date: Wed, 13 Apr 2022 21:55:03 +0300
Message-ID: <CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com> (raw)
In-Reply-To: <CA+TgmoZBgNipyKuQAJzNw2w7C9z+2SMC0SAHqCnc_dG1nSLNcw@mail.gmail.com>
References: <CAF4Au4zsdZ3t=f+YAaq12-SzqfCxfOTc1NanjBcUsw+5L-0iiA@mail.gmail.com>
	<[email protected]>
	<CA+TgmoYOZ0Ofoo1DJ+iRa6Mg8MACu0eb8tr-uggfNMZmD6bpkA@mail.gmail.com>
	<[email protected]>
	<CAN-LCVNj0iLHRA4CzZHk3-BEt2-47Xbx1h020ReB0LA-=5H9YA@mail.gmail.com>
	<[email protected]>
	<CAN-LCVMvMvnopi3Q15o1sJRH8Tg+_T8USA0WKgWc-Nk330UkZQ@mail.gmail.com>
	<CAM-w4HP3xizUywZMh4bhJWgD7_vPcG5C8sU=YzmGCpp-9aX=5w@mail.gmail.com>
	<CAN-LCVOA9y8enbxfci9O28TeETARBrrnuu0aBowS=MSBMJnWaA@mail.gmail.com>
	<CAM-w4HMTw3tAoo_843YUef95JUBZYzrNDZNvCF3vAmPhHsS3aQ@mail.gmail.com>
	<[email protected]>
	<CAN-LCVN8WMk0zbJrqpq3wQFPvunMjsdCj4y5gyEuyH0+4Ax-DA@mail.gmail.com>
	<CA+Tgmobhqw4kr5wZaA08_XJirZzgfohtR0BOgB2UNRTOcnjLmQ@mail.gmail.com>
	<CAN-LCVP94miKg1j5GF+WVhyG4zDPF4ruG8ZnCR-4cBpG=rhbSQ@mail.gmail.com>
	<CA+TgmoZBgNipyKuQAJzNw2w7C9z+2SMC0SAHqCnc_dG1nSLNcw@mail.gmail.com>

Hi,
I reworked previous patch set according to recommendations. Patches
are generated by format-patch and applied by git am. Patches are based on
master from 03.11. Also, now we've got clean branch with incremental
commits
which could be easily rebased onto a fresh master.

Currently, there are 8 patches:

1) 0001_create_table_storage_v3.patch - SET STORAGE option for CREATE
TABLE command by Teodor Sigaev which is required by all the following
functionality;

2) 0002_toaster_interface_v6.patch - Toaster API (SQL syntax for toasters +
API)
with Dummy toaster as an example of how this API should be used, but with
default
toaster left 'as-is';

3) 0003_toaster_default_v5.patch - default (regular) toaster is implemented
via new API;

4) 0004_toaster_snapshot_v5.patch - refactoring of default toaster and
support
of versioned toasted rows;

5) 0005_bytea_appendable_toaster_v5.patch - bytea toaster by Nikita Glukhov
Custom toaster for bytea data with support of appending (instead of
rewriting)
stored data;

6) 0006_toasterapi_docs_v1.patch - brief documentation on Toaster API in Pg
docs;

7) 0007_fix_alignment_of_custom_toast_pointers.patch - fixes custom toast
pointer's
alignment required by bytea toaster by Nikita Glukhov;

8) 0008_fix_toast_tuple_externalize.patch - fixes toast_tuple_externalize
function
not to call toast if old data is the same as new one.

I would be grateful for feedback on the reworked patch set.

On Mon, Apr 4, 2022 at 11:18 PM Robert Haas <[email protected]> wrote:

> On Mon, Apr 4, 2022 at 4:05 PM Nikita Malakhov <[email protected]> wrote:
> > - Is 'git apply' not a valid way to apply such patches?
>
> I have found that it never works. This case is no exception:
>
> [rhaas pgsql]$ git apply ~/Downloads/1_toaster_interface_v4.patch
> /Users/rhaas/Downloads/1_toaster_interface_v4.patch:253: trailing
> whitespace.
> toasterapi.o
> /Users/rhaas/Downloads/1_toaster_interface_v4.patch:1276: trailing
> whitespace.
> {
> /Users/rhaas/Downloads/1_toaster_interface_v4.patch:1294: trailing
> whitespace.
>  * CREATE TOASTER name HANDLER handler_name
> /Users/rhaas/Downloads/1_toaster_interface_v4.patch:2261: trailing
> whitespace.
>  * va_toasterdata could contain varatt_external structure for old Toast
> /Users/rhaas/Downloads/1_toaster_interface_v4.patch:3047: trailing
> whitespace.
> SELECT attnum, attname, atttypid, attstorage, tsrname
> error: patch failed: src/backend/commands/tablecmds.c:42
> error: src/backend/commands/tablecmds.c: patch does not apply
> error: patch failed: src/backend/commands/tablecmds.c:943
> error: src/backend/commands/tablecmds.c: patch does not apply
> error: patch failed: src/backend/commands/tablecmds.c:973
> error: src/backend/commands/tablecmds.c: patch does not apply
> error: patch failed: src/backend/commands/tablecmds.c:44
> error: src/backend/commands/tablecmds.c: patch does not apply
>
> I would really encourage you to use 'git format-patch' to generate a
> stack of patches. But there is no point in reposting 30+ patches that
> haven't been properly refactored into separate chunks. You need to
> maintain a branch, periodically rebased over master, with some
> probably-small number of patches on it, each of which is a logically
> independent patch with its own commit message, its own clear purpose,
> etc. And then generate patches to post from there using 'git
> format-patch'. Look into using 'git rebase -i --autosquash' and 'git
> commit --fixup' to maintain the branch, if you're not already familiar
> with those things.
>
> Also, it is a really good idea when you post the patch set to include
> in the email a clear description of the overall purpose of the patch
> set and what each patch does toward that goal. e.g. "The overall goal
> of this patch set is to support faster-than-light travel. Currently,
> PostgreSQL does not know anything about the speed of light, so 0001
> adds some code for speed-of-light detection. Building on this, 0002
> adds general support for disabling physical laws of the universe.
> Then, 0003 makes use of this support to disable specifically the speed
> of light." Perhaps you want a little more text than that for each
> patch, depending on the situation, but this gives you the idea, I
> hope.
>
> --
> Robert Haas
> EDB: http://www.enterprisedb.com
>


-- 
Regards,
Nikita Malakhov
Postgres Professional
https://postgrespro.ru/


Attachments:

  [application/x-gzip] 0005_bytea_appendable_toaster_v5.patch.gz (5.6K, ../CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com/3-0005_bytea_appendable_toaster_v5.patch.gz)
  download

  [application/x-gzip] 0004_toaster_snapshot_v5.patch.gz (8.1K, ../CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com/4-0004_toaster_snapshot_v5.patch.gz)
  download

  [application/x-gzip] 0001_create_table_storage_v3.patch.gz (4.3K, ../CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com/5-0001_create_table_storage_v3.patch.gz)
  download

  [application/x-gzip] 0003_toaster_default_v5.patch.gz (30.0K, ../CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com/6-0003_toaster_default_v5.patch.gz)
  download

  [application/x-gzip] 0002_toaster_interface_v6.patch.gz (46.0K, ../CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com/7-0002_toaster_interface_v6.patch.gz)
  download

  [application/x-gzip] 0006_toasterapi_docs_v1.patch.gz (3.9K, ../CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com/8-0006_toasterapi_docs_v1.patch.gz)
  download

  [application/x-gzip] 0008_fix_toast_tuple_externalize.patch.gz (579B, ../CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com/9-0008_fix_toast_tuple_externalize.patch.gz)
  download

  [application/x-gzip] 0007_fix_alignment_of_custom_toast_pointers.patch.gz (780B, ../CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com/10-0007_fix_alignment_of_custom_toast_pointers.patch.gz)
  download

view thread (39+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Pluggable toaster
  In-Reply-To: <CAN-LCVPximi0n6C7CN83Xq8-jpBw0cOaC9fkBHNr0qo7Z4Fsjw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox