Re: logical changeset generation v6.8

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logical changeset generation v6.8
Date: 2013-12-04 15:55:10
Message-ID: 20131204155510.GO24801@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-12-03 15:19:26 -0500, Robert Haas wrote:
> Yeah, you're right. I think the current logic will terminate when all
> flags are set to false or all attribute numbers have been checked, but
> it doesn't know that if HOT's been disproven then we needn't consider
> further HOT columns. I think the way to fix that is to tweak this
> part:
>
> + if (next_hot_attnum > FirstLowInvalidHeapAttributeNumber)
> check_now = next_hot_attnum;
> + else if (next_key_attnum > FirstLowInvalidHeapAttributeNumber)
> + check_now = next_key_attnum;
> + else if (next_id_attnum > FirstLowInvalidHeapAttributeNumber)
> + check_now = next_id_attnum;
> else
> + break;
>
> What I think we ought to do there is change each of those criteria to
> say if (hot_result && next_hot_attnum >
> FirstLowInvalidHeapAttributeNumber) and similarly for the other two.
> That way we consider each set a valid source of attribute numbers only
> until the result flag for that set flips false.

That seems to work well, yes.

Updated & rebased series attached.

* Rebased since the former patch 01 has been applied
* Lots of smaller changes in the wal_level=logical patch
* Use Robert's version of wal_level=logical, with the above fixes
* Use only macros for RelationIsAccessibleInLogicalDecoding/LogicallyLogged
* Moved a mit more logic into ExtractReplicaIdentity
* some comment copy-editing
* Bug noted by Euler fixed, testcase added
* Some copy editing in later patches, nothing significant.

I've primarily sent this, because I don't know of further required
changes in 0001-0003. I am trying reviewing the other patches in detail
atm.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-wal_decoding-Add-wal_level-logical-and-log-data-requ.patch.gz application/x-patch-gzip 17.5 KB
0002-wal_decoding-Log-xl_running_xact-s-at-a-higher-frequ.patch.gz application/x-patch-gzip 3.1 KB
0003-wal_decoding-Add-option-to-use-user-defined-tables-a.patch.gz application/x-patch-gzip 1.8 KB
0004-wal_decoding-Introduce-wal-decoding-via-catalog-time.patch.gz application/x-patch-gzip 77.3 KB
0005-wal_decoding-Only-peg-the-xmin-horizon-for-catalog-t.patch.gz application/x-patch-gzip 5.3 KB
0006-wal_decoding-Allow-walsender-s-to-connect-to-a-speci.patch.gz application/x-patch-gzip 4.0 KB
0007-wal_decoding-logical-changeset-extraction-walsender-.patch.gz application/x-patch-gzip 10.1 KB
0008-wal_decoding-test_decoding-Add-a-simple-decoding-mod.patch.gz application/x-patch-gzip 3.6 KB
0009-wal_decoding-pg_recvlogical-Introduce-pg_receivexlog.patch.gz application/x-patch-gzip 9.1 KB
0010-wal_decoding-test_logical_decoding-Add-extension-for.patch.gz application/x-patch-gzip 23.9 KB
0011-wal_decoding-design-document-v2.4-and-snapshot-build.patch.gz application/x-patch-gzip 12.9 KB
0012-wal_decoding-Temporarily-add-logical-decoding-regres.patch.gz application/x-patch-gzip 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-12-04 15:58:54 Re: Minor patch for the uuid-ossp extension
Previous Message Peter Eisentraut 2013-12-04 15:51:21 Re: RFC: programmable file format for postgresql.conf