Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-02-04 Thread Robert Haas
On Sat, Feb 2, 2013 at 4:38 PM, Andres Freund and...@2ndquadrant.com wrote: On 2013-01-28 16:55:52 -0500, Steve Singer wrote: If your using non-surragate /natural primary keys this tends to come up occasionally due to data-entry errors or renames. I'm looking at this from the point of view

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-02-02 Thread Andres Freund
On 2013-01-28 16:55:52 -0500, Steve Singer wrote: If your using non-surragate /natural primary keys this tends to come up occasionally due to data-entry errors or renames. I'm looking at this from the point of view of what do I need to use this as a source for a production replication system

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-28 Thread Andres Freund
On 2013-01-26 16:20:33 -0500, Steve Singer wrote: On 13-01-24 11:15 AM, Steve Singer wrote: On 13-01-24 06:40 AM, Andres Freund wrote: Fair enough. I am also working on a user of this infrastructure but that doesn't help you very much. Steve Singer seemed to make some stabs at writing an

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-28 Thread Andres Freund
Hi, On 2013-01-27 23:07:51 -0500, Steve Singer wrote: A few more comments; In decode.c DecodeDelete + if (r-xl_len = (SizeOfHeapDelete + SizeOfHeapHeader)) + { + elog(DEBUG2, huh, no primary key for a delete on wal_level = logical?); + return; + } + I think we

Re: [HACKERS] logical changeset generation v4

2013-01-28 Thread Andres Freund
On 2013-01-27 12:28:21 -0500, Steve Singer wrote: On 13-01-22 11:30 AM, Andres Freund wrote: Hi, I pushed a new rebased version (the xlogreader commit made it annoying to merge). The main improvements are * way much coherent code internally for intializing logical rep * explicit control

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-28 Thread Steve Singer
On 13-01-28 06:17 AM, Andres Freund wrote: Hi, 3. Pass the delete (with no key values) onto the replication client and let it deal with it (see 1 and 2) Hm. While I agree that nicer behaviour would be good I think the real enforcement should happen on a higher level, e.g. with event triggers

Re: [HACKERS] logical changeset generation v4

2013-01-28 Thread Steve Singer
On 13-01-28 06:23 AM, Andres Freund wrote: The CF is also there to find UI warts and such, so something like this seems perfectly fine. Even moreso as it doesn't look this will get into 9.3 anyway. I wanted to add such an option, but I was too lazy^Wbusy to think about the sematics. Your

Re: [HACKERS] logical changeset generation v4

2013-01-28 Thread Andres Freund
On 2013-01-28 12:23:02 +0100, Andres Freund wrote: On 2013-01-27 12:28:21 -0500, Steve Singer wrote: On 13-01-22 11:30 AM, Andres Freund wrote: Hi, I pushed a new rebased version (the xlogreader commit made it annoying to merge). The main improvements are * way much coherent

Re: [HACKERS] logical changeset generation v4

2013-01-27 Thread Steve Singer
On 13-01-22 11:30 AM, Andres Freund wrote: Hi, I pushed a new rebased version (the xlogreader commit made it annoying to merge). The main improvements are * way much coherent code internally for intializing logical rep * explicit control over slots * options for logical replication Exactly

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-27 Thread Steve Singer
On 13-01-24 11:15 AM, Steve Singer wrote: On 13-01-24 06:40 AM, Andres Freund wrote: Fair enough. I am also working on a user of this infrastructure but that doesn't help you very much. Steve Singer seemed to make some stabs at writing an output plugin as well. Steve, how far did you get

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-26 Thread Steve Singer
On 13-01-24 11:15 AM, Steve Singer wrote: On 13-01-24 06:40 AM, Andres Freund wrote: Fair enough. I am also working on a user of this infrastructure but that doesn't help you very much. Steve Singer seemed to make some stabs at writing an output plugin as well. Steve, how far did you get

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Simon Riggs
On 24 January 2013 01:17, Robert Haas robertmh...@gmail.com wrote: I agree. The thing that scares me about the logical replication stuff is not that it might be slow (and if your numbers are to be believed, it isn't), but that I suspect it's riddled with bugs and possibly some questionable

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Heikki Linnakangas
On 24.01.2013 00:30, Andres Freund wrote: Hi, I decided to reply on the patches thread to be able to find this later. On 2013-01-23 22:48:50 +0200, Heikki Linnakangas wrote: logical changeset generation v4 This is a boatload of infrastructure for supporting logical replication, yet we have no

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Andres Freund
Hi Robert, Hi all, On 2013-01-23 20:17:04 -0500, Robert Haas wrote: On Wed, Jan 23, 2013 at 5:30 PM, Andres Freund and...@2ndquadrant.com wrote: The only reason the submitted version of logical decoding is comparatively slow is that its xmin update policy is braindamaged, working on that

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Heikki Linnakangas
One random thing that caught my eye in the patch, I though I'd mention it while I still remember: In heap_delete, you call heap_form_tuple() in a critical section. That's a bad idea, because if it runs out of memory - PANIC. - Heikki -- Sent via pgsql-hackers mailing list

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Andres Freund
On 2013-01-24 12:38:25 +0200, Heikki Linnakangas wrote: On 24.01.2013 00:30, Andres Freund wrote: Hi, I decided to reply on the patches thread to be able to find this later. On 2013-01-23 22:48:50 +0200, Heikki Linnakangas wrote: logical changeset generation v4 This is a boatload of

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Steve Singer
On 13-01-24 06:40 AM, Andres Freund wrote: Fair enough. I am also working on a user of this infrastructure but that doesn't help you very much. Steve Singer seemed to make some stabs at writing an output plugin as well. Steve, how far did you get there? I was able to get something that

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Robert Haas
On Thu, Jan 24, 2013 at 6:14 AM, Andres Freund and...@2ndquadrant.com wrote: Thats way much more along the lines of what I am afraid of than the performance stuff - but Heikki cited those, so I replied to that. Note that I didn't say this must, must go in - I just don't think Heikki's

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: Now, the bad news is, I don't think it's very reasonable to try to commit this to 9.3. I think it is just too much stuff too late in the cycle. I've reviewed some of the patches from time to time but there is a lot more stuff and it's big and

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Heikki Linnakangas
On 24.01.2013 20:27, Robert Haas wrote: Before getting bogged down in technical commentary, let me say this very clearly: I am enormously grateful for your work on this project. Logical replication based on WAL decoding is a feature of enormous value that PostgreSQL has needed for a long time,

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Andres Freund
Hi! On 2013-01-24 13:27:00 -0500, Robert Haas wrote: On Thu, Jan 24, 2013 at 6:14 AM, Andres Freund and...@2ndquadrant.com wrote: Before getting bogged down in technical commentary, let me say this very clearly: I am enormously grateful for your work on this project. Logical replication

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-24 Thread Bruce Momjian
On Fri, Jan 25, 2013 at 02:16:09AM +0100, Andres Freund wrote: What I am afraid though is that it basically goes on like this in the next commitfests: * 9.4-CF1: no serious reviewer comments because they are busy doing release work * 9.4-CF2: all are relieved that the release is over and a

Re: [HACKERS] logical changeset generation v4

2013-01-23 Thread Andres Freund
On 2013-01-19 23:42:02 -0500, Steve Singer wrote: 5) Currently its only allowed to access catalog tables, its fairly trivial to extend this to additional tables if you can accept some (noticeable but not too big) overhead for modifications on those tables. I was thinking of making that an

Re: [HACKERS] logical changeset generation v4

2013-01-23 Thread Robert Haas
On Wed, Jan 23, 2013 at 7:14 AM, Andres Freund and...@2ndquadrant.com wrote: With the (attached for convenience) patch applied you can do # ALTER TABLE replication_metadata SET (treat_as_catalog_table = true); to enable this. What I wonder about is: * does anybody have a better name for the

Re: [HACKERS] logical changeset generation v4

2013-01-23 Thread Andres Freund
On 2013-01-23 10:18:50 -0500, Robert Haas wrote: On Wed, Jan 23, 2013 at 7:14 AM, Andres Freund and...@2ndquadrant.com wrote: With the (attached for convenience) patch applied you can do # ALTER TABLE replication_metadata SET (treat_as_catalog_table = true); to enable this. What I

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-23 Thread Andres Freund
Hi, I decided to reply on the patches thread to be able to find this later. On 2013-01-23 22:48:50 +0200, Heikki Linnakangas wrote: logical changeset generation v4 This is a boatload of infrastructure for supporting logical replication, yet we have no code actually implementing logical

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-23 Thread Robert Haas
On Wed, Jan 23, 2013 at 5:30 PM, Andres Freund and...@2ndquadrant.com wrote: pgbench upstream: tps: 22275.941409 space overhead: 0% pgbench logical-submitted tps: 16274.603046 space overhead: 2.1% pgbench logical-HEAD (will submit updated version tomorrow or so): tps: 20853.341551 space

Re: [HACKERS] logical changeset generation v4 - Heikki's thoughts about the patch state

2013-01-23 Thread Joshua D. Drake
On 01/23/2013 05:17 PM, Robert Haas wrote: Of course, I have no evidence that that will happen. But it is a really big piece of code, and therefore unless you are superman, it's probably got a really large number of bugs. The scary thing is that it is not as if we can say, well, this is a

Re: [HACKERS] logical changeset generation v4

2013-01-22 Thread Andres Freund
Hi, I pushed a new rebased version (the xlogreader commit made it annoying to merge). The main improvements are * way much coherent code internally for intializing logical rep * explicit control over slots * options for logical replication On 2013-01-19 23:42:02 -0500, Steve Singer wrote: On

Re: [HACKERS] logical changeset generation v4

2013-01-20 Thread Robert Haas
On Fri, Jan 18, 2013 at 12:32 PM, Andres Freund and...@2ndquadrant.com wrote: Makes sense? Yes. The catalog timetravel stuff still gives me heartburn. The idea of treating system catalogs in a special way has never sat well with me and still doesn't - not that I am sure what I'd like better.

Re: [HACKERS] logical changeset generation v4

2013-01-20 Thread Andres Freund
On 2013-01-20 21:45:11 -0500, Robert Haas wrote: On Fri, Jan 18, 2013 at 12:32 PM, Andres Freund and...@2ndquadrant.com wrote: Makes sense? Yes. The catalog timetravel stuff still gives me heartburn. The idea of treating system catalogs in a special way has never sat well with me and

Re: [HACKERS] logical changeset generation v4

2013-01-19 Thread Steve Singer
On 13-01-14 08:38 PM, Andres Freund wrote: Hi everyone, Here is the newest version of logical changeset generation. 2) Currently the logical replication infrastructure assigns a 'slot-id' when a new replica is setup. That slot id isn't really nice (e.g. id-321578-3). It also requires that

Re: [HACKERS] logical changeset generation v4

2013-01-18 Thread Alvaro Herrera
Andres Freund wrote: [09] Adjust all *Satisfies routines to take a HeapTuple instead of a HeapTupleHeader For timetravel access to the catalog we need to be able to lookup (cmin, cmax) pairs of catalog rows when were 'inside' that TX. This patch just adapts the signature of the *Satisfies

Re: [HACKERS] logical changeset generation v4

2013-01-18 Thread Alvaro Herrera
Alvaro Herrera wrote: I had a look at this part. Running the regression tests unveiled a case where the tableOid wasn't being set (and thus caused an assertion to fail), so I added that. I also noticed that the additions to pruneheap.c are sometimes filling a tuple before it's strictly

Re: [HACKERS] logical changeset generation v4

2013-01-18 Thread Robert Haas
On Fri, Jan 18, 2013 at 11:33 AM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Andres Freund wrote: [09] Adjust all *Satisfies routines to take a HeapTuple instead of a HeapTupleHeader For timetravel access to the catalog we need to be able to lookup (cmin, cmax) pairs of catalog rows

Re: [HACKERS] logical changeset generation v4

2013-01-18 Thread Andres Freund
On 2013-01-18 11:48:43 -0500, Robert Haas wrote: On Fri, Jan 18, 2013 at 11:33 AM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Andres Freund wrote: [09] Adjust all *Satisfies routines to take a HeapTuple instead of a HeapTupleHeader For timetravel access to the catalog we need to

Re: [HACKERS] logical changeset generation v4

2013-01-18 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I took a quick look at this and am just curious why we're adding the requirement that t_tableOid has to be initialized? I assume he meant it had been left at a random value, which is surely bad practice even if a specific usage doesn't fall over today.

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Andres Freund
On 2013-01-15 17:41:50 +1300, Mark Kirkwood wrote: On 15/01/13 17:37, Mark Kirkwood wrote: On 15/01/13 14:38, Andres Freund wrote: Hi everyone, Here is the newest version of logical changeset generation. I'm quite interested in this feature - so tried applying the 19 patches to

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Andres Freund
On 2013-01-15 01:00:00 -0300, Alvaro Herrera wrote: Andres Freund wrote: I've been giving a couple of these parts a look. In particular [03] Split out xlog reading into its own module called xlogreader Cleaned this one up a bit last week. I will polish it some more, publish for some

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Alvaro Herrera
Andres Freund wrote: On 2013-01-15 01:00:00 -0300, Alvaro Herrera wrote: Andres Freund wrote: I've been giving a couple of these parts a look. In particular [03] Split out xlog reading into its own module called xlogreader Cleaned this one up a bit last week. I will polish it

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Andres Freund
On 2013-01-15 09:56:41 -0300, Alvaro Herrera wrote: Andres Freund wrote: On 2013-01-15 01:00:00 -0300, Alvaro Herrera wrote: Andres Freund wrote: I've been giving a couple of these parts a look. In particular [03] Split out xlog reading into its own module called xlogreader

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-01-15 09:56:41 -0300, Alvaro Herrera wrote: Oh, hm. Maybe the contrib module's make installcheck, then? Thats what I do right now, but I really would prefer to have it checked during normal make checks, installchecks aren't run all that

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Andres Freund
On 2013-01-15 10:28:28 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2013-01-15 09:56:41 -0300, Alvaro Herrera wrote: Oh, hm. Maybe the contrib module's make installcheck, then? Thats what I do right now, but I really would prefer to have it checked during

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: But the other part of the problem is hiding in the unfortunately removed part of the problem description - the tests require the non-default options wal_level=logical and max_logical_slots=3+. Oh. Well, that's not going to work. Is there a

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Andres Freund
On 2013-01-15 11:10:22 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: But the other part of the problem is hiding in the unfortunately removed part of the problem description - the tests require the non-default options wal_level=logical and max_logical_slots=3+. Oh.

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-01-15 11:10:22 -0500, Tom Lane wrote: I think the only reasonable way to handle this would be to (1) make make installcheck a no-op in this contrib module, and (2) make make check work, being careful to start the test postmaster with the

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Alvaro Herrera
Andres Freund wrote: On 2013-01-15 09:56:41 -0300, Alvaro Herrera wrote: Andres Freund wrote: On 2013-01-15 01:00:00 -0300, Alvaro Herrera wrote: Andres Freund wrote: I've been giving a couple of these parts a look. In particular [03] Split out xlog reading into its

Re: [HACKERS] logical changeset generation v4

2013-01-15 Thread Andres Freund
On 2013-01-15 15:16:44 -0300, Alvaro Herrera wrote: Andres Freund wrote: On 2013-01-15 09:56:41 -0300, Alvaro Herrera wrote: Andres Freund wrote: On 2013-01-15 01:00:00 -0300, Alvaro Herrera wrote: Andres Freund wrote: I've been giving a couple of these parts a look. In

Re: [HACKERS] logical changeset generation v4

2013-01-14 Thread Josh Berkus
Andreas, Is there a git fork for logical replication somewhere? -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] logical changeset generation v4

2013-01-14 Thread anara...@anarazel.de
Josh Berkus j...@agliodbs.com schrieb: Andreas, Is there a git fork for logical replication somewhere? Check the bottom of the email ;) --- Please excuse brevity and formatting - I am writing this on my mobile phone. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] logical changeset generation v4

2013-01-14 Thread Abhijit Menon-Sen
At 2013-01-14 18:15:39 -0800, j...@agliodbs.com wrote: Is there a git fork for logical replication somewhere? git://git.postgresql.org/git/users/andresfreund/postgres.git, branch xlog-decoding-rebasing-cf4 (and xlogreader_v4). -- Abhijit -- Sent via pgsql-hackers mailing list

Re: [HACKERS] logical changeset generation v4

2013-01-14 Thread Abhijit Menon-Sen
At 2013-01-15 02:38:45 +0100, and...@2ndquadrant.com wrote: 2) Currently the logical replication infrastructure assigns a 'slot-id' when a new replica is setup. That slot id isn't really nice (e.g. id-321578-3). It also requires that [18] keeps state in a global variable to make writing

Re: [HACKERS] logical changeset generation v4

2013-01-14 Thread Alvaro Herrera
Andres Freund wrote: I've been giving a couple of these parts a look. In particular [03] Split out xlog reading into its own module called xlogreader Cleaned this one up a bit last week. I will polish it some more, publish for some final comments, and commit. [08] wal_decoding: Introduce

Re: [HACKERS] logical changeset generation v4

2013-01-14 Thread Mark Kirkwood
On 15/01/13 14:38, Andres Freund wrote: Hi everyone, Here is the newest version of logical changeset generation. I'm quite interested in this feature - so tried applying the 19 patches to the latest 9.3 checkout. Patch and compile are good. However portals seem busted: bench=# BEGIN;

Re: [HACKERS] logical changeset generation v4

2013-01-14 Thread Mark Kirkwood
On 15/01/13 17:37, Mark Kirkwood wrote: On 15/01/13 14:38, Andres Freund wrote: Hi everyone, Here is the newest version of logical changeset generation. I'm quite interested in this feature - so tried applying the 19 patches to the latest 9.3 checkout. Patch and compile are good.