X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 2179C9FB215 for ; Tue, 8 Aug 2006 15:23:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 62009-08 for ; Tue, 8 Aug 2006 18:23:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from dcs.lsd.di.uminho.pt (linux.di.uminho.pt [193.136.19.96]) by postgresql.org (Postfix) with ESMTP id A55709FAE4E for ; Tue, 8 Aug 2006 15:23:08 -0300 (ADT) Received: (qmail 10021 invoked by uid 89); 8 Aug 2006 18:41:23 -0000 Received: from unknown (HELO ?192.168.82.115?) (alfranio@lsd.di.uminho.pt@192.168.82.115) by dcs.lsd.di.uminho.pt with ESMTPA; 8 Aug 2006 18:41:23 -0000 Message-ID: <44D8D68C.8050408@lsd.di.uminho.pt> Date: Tue, 08 Aug 2006 19:23:08 +0100 From: alfranio correia junior User-Agent: Thunderbird 1.5.0.5 (X11/20060728) MIME-Version: 1.0 To: Markus Schiltknecht CC: Jose Orlando Pereira , pgsql-hackers@postgresql.org Subject: Re: standard interfaces for replication providers References: <44D30B31.2070403@lsd.di.uminho.pt> <200608041733.24228.jop@lsd.di.uminho.pt> <44D70EDA.9060602@bluegap.ch> <200608071940.26750.jop@lsd.di.uminho.pt> <44D89EA5.5090703@bluegap.ch> In-Reply-To: <44D89EA5.5090703@bluegap.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.72 tagged_above=0 required=5 tests=SARE_SPEC_REPLICA X-Spam-Level: X-Archive-Number: 200608/495 X-Sequence-Number: 87988 Markus Schiltknecht wrote: > Hi, > > Jose Orlando Pereira wrote: >> Sorry, stuff was put twice in the zip file making it somewhat >> confusing. It is in >> postgresql-g-0.1/javasrc/GordaInterfaces/docs/gapi.pdf or directly on >> the web site at http://gorda.di.uminho.pt/download/reports/gapi.pdf. > > Thank you. I've just had a quick glance at it. > >> Can you point out why is it [limiting], given that it is admittedly >> quite close? > > An API is always limiting. And if you have to change the API a lot, to > fit your needs, what's the point in using it at all? Good APIs don't > change a lot. > > Even if it's quite close, I estimate the effort to port Postgres-R to > use your API to be quite large. I.e. the first missing thing that came > to my mind was the ordering of processes when waking them up after > waiting for a lock. Postgres-R needs the processes to be woken up in > the order of writeset arrival. > > Now, I didn't see anything related in the patch, but the gapi.pdf has > 'Predictable Deadlock Handling' in it. I need to take another look... If I correctly understood your idea, a priority mechanism would be enough to do so and different applications might exploit it. Most likely, we need this to apply remote transactions. However, note that a priority mechanism is not only of interesting in the field of replication systems but it might be used to improve performance for instance. Take a look at the ideas presented in http://www.cs.cmu.edu/~bianca/icde04.pdf Unfortunately, our current "prototype" only provides two levels: high priority or normal priority. Definitely, it should be improved and we are aware of that. > >> We'd rather discuss specific issues instead of the general topic of >> whether to build APIs around them. We certainly are not married to >> the proposed interfaces, although the functionality they capture does >> reflect our experience with several algorithms. > > I still feel that I would need ways too many hooks. Especially when > you consider advanced replication features such as data partitioning > and remote query execution. > > What also worries me is the use of triggers. ISTM that using triggers > is not deep enough in the database. In the above example, do I really > want to fire a trigger every time the database needs to wake up a > process? In PostgreSQL a trigger normally runs within a transaction. > How do you work around that? I think we are talking about different levels.... as I said a high priority mechanism would be enough. In this case, the API should provide only an interface to set the priority of a transaction.... In our case, still unfinished and quite simple: "set transaction master" but it could be easily transformed into "set transaction priority ". Best regards, Alfranio Junior.