Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node - Mailing list pgsql-hackers
From | Simon Riggs |
---|---|
Subject | Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node |
Date | |
Msg-id | CA+U5nMJrbrjPzxaTxuUMxEyNRk8Z1W--jrXTMmwr-whFbV8NcQ@mail.gmail.com Whole thread Raw |
In response to | Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
Responses |
Re: [PATCH 10/16] Introduce the concept that wal has a
'origin' node
|
List | pgsql-hackers |
On 20 June 2012 15:45, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: > On 20.06.2012 10:32, Simon Riggs wrote: >> >> On 20 June 2012 14:40, Heikki Linnakangas >>> >>> And I'm worried >>> >>> it might not even be enough in more complicated scenarios. >> >> >> It is not the only required conflict mechanism, and has never been >> claimed to be so. It is simply one piece of information needed, at >> various times. > > > So, if the origin id is not sufficient for some conflict resolution > mechanisms, what extra information do you need for those, and where do you > put it? As explained elsewhere, wal_level = logical (or similar) would be used to provide any additional logical information required. Update and Delete WAL records already need to be different in that mode, so additional info would be placed there, if there were any. In the case of reflexive updates you raised, a typical response in other DBMS would be to represent the query UPDATE SET counter = counter + 1 by sending just the "+1" part, not the current value of counter, as would be the case with the non-reflexive update UPDATE SET counter = 1 Handling such things in Postgres would require some subtlety, which would not be resolved in first release but is pretty certain not to require any changes to the WAL record header as a way of resolving it. Having already thought about it, I'd estimate that is a very long discussion and not relevant to the OT, but if you wish to have it here, I won't stop you. >>> Perhaps we need a more generic WAL record annotation system, where a >>> plugin >>> can tack arbitrary information to WAL records. The extra information >>> could >>> be stored in the WAL record after the rmgr payload, similar to how backup >>> blocks are stored. WAL replay could just ignore the annotations, but a >>> replication system could use it to store the origin id or whatever extra >>> information it needs. >> >> >> Additional information required by logical information will be handled >> by a new wal_level. >> >> The discussion here is about adding origin_node_id *only*, which needs >> to be added on each WAL record. > > > If that's all we can discuss here is, and all other options are off the > table, then I'll have to just outright object to this patch. Let's implement > what we can without the origin id, and revisit this later. As explained, we can do nothing without the origin id. It is not optional or avoidable in the way you've described. We have the choice to add the required information as a static or as a variable length addition to the WAL record header. Since there is no additional requirement for expansion of the header at this point and no measurable harm in doing so, I suggest we avoid the complexity and lack of robustness that a variable length header would cause. Of course, we can go there later if needed, but there is no current need. If a variable length header had been suggested, it is certain somebody would say that was overcooked and just do it as static. -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
pgsql-hackers by date: