Michael

Postgres-XC, write-scalable multi-master symmetric cluster based on PostgreSQL, version 1.0beta2 has been released.
This beta version is based on PostgreSQL 9.1.3. All the patches in PostgreSQL 9.1 stable branch have been merged up to commit 1c0e678 (4th of May 2012).

You can download the tarball directly from here.
This tarball contains all the HTML and man documentation.

The following enhancements have been made since release of 1.0beta1:

  • Redaction of release notes, summarizing all the features added in Postgres-XC since the creation of the project
  • Support for make world
  • Regressions stabilized (no failures for 139 tests)
  • Fix of more than 50 bugs
  • Merge with stable branch of PostgreSQL 9.1 (600~ commits)

Compared to version Postgres-XC 0.9.7, the following features have been added:

  • Fast query shipping (FQS), quick identification of expressions in a query that can be pushed down to remote nodes
  • SERIAL types
  • TABLESPACE
  • Utility to clean up 2PC transactions in cluster (pgxc_clean)
  • Utility for initialization of GTM (global transaction manager, utility called initgtm)
  • Relation-size functions
  • Regression stabilization

The release notes of 1.0 are directly available here.

The project can be followed on Source Forge.
And the project uses a couple of GIT repositories for development:

Postgres-XC 1.0beta2 will be used during the Postgres-XC tutorial at PGCon in Ottawa, so be sure to touch this beta version to have an idea of what Postgres-XC is before attending!

One of the features that has been really improved the last couple of weeks is the stabilization of remote query planning for DML for Postgres-XC standard planner. And this has consequences on rules, because a rule is fired on Coordinators by design, and you need to provide a global way to plan queries correctly with remote nodes. Just to recall, a rule is the possibility to define an alternative action when doing an INSERT, UPDATE or DELETE on a table.
Another important point is that the query of a rules is not planned at the moment of the rule creation, but after rule is fired, however it doesn’t change the fact that a correct query planning is needed at a moment or another.

A rule can for example be used to define DML on views.
A view is roughly a projection of table data into a wanted shape, and it is by default not possible to define DML actions on it.

Let’s take an example, here are a simple table and a simple view.
postgres=# CREATE TEMP TABLE t1 (a int PRIMARY KEY, b int) DISTRIBUTE BY HASH(a);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
CREATE TABLE
postgres=# INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4);
INSERT 0 4
postgres=# CREATE VIEW t1_v AS SELECT a AS a_v, b AS b_v FROM t1;
NOTICE: view "t1_v" will be a temporary view
CREATE VIEW

When trying to UPDATE the view, you will get the following error.
postgres=# UPDATE t1_v SET b_v = 2 WHERE a_v = 3;
ERROR: cannot update view "t1_v"
HINT: You need an unconditional ON UPDATE DO INSTEAD rule or an INSTEAD OF UPDATE trigger.

So let’s define a view on it and check that an UPDATE on a view is possible.
postgres=# CREATE RULE t1_upd AS ON UPDATE TO t1_v DO INSTEAD UPDATE t1 SET b = new.b_v WHERE a = old.a_v AND b = old.b_v;
CREATE RULE
postgres=# UPDATE t1_v SET b_v = 2 WHERE a_v = 3;
UPDATE 1
postgres=# select * from t1_v;
a_v | b_v
-----+-----
1 | 1
2 | 2
4 | 4
3 | 2
(4 rows)

So yes, RULES are now completely supported in Postgres-XC. And it is included in 1.0. The secret of how it works? The thing that took me 4 weeks to figure out?
Well, some extensions have been added in standard planner for DELETE, INSERT and UPDATE remote planning (ModifyTable used as TopPlan). For people willing to look at the code, all the secrets are located in functions create_remoteinsert_plan, create_remoteupdate_plan and create_remotedelete_plan of createplan.c. Those functions have been built and adapted to former scan plan of PostgreSQL to react as a wrapper for inner remote table scans within PostgreSQL standard planner. The trick is to create a DML query generated based on the scan plans generated for each tables that has to be updated, deleted or insert.

One of the limitations? The use of constraints.
Depending on the distribution strategy used, you may not be able to check the consistency of constraints globally.
But this is another story…

This year, Postgres-XC has a tutorial at PGCon. Yeah.
Based on the schedule of PGCon 2012, XC team has 3 hours to make you masters of this cluster based on PostgreSQL.

We are working hard at shaping up the presentation flow following those guidelines.

  1. Postgres-XC, what it is and what it is not
  2. Postgres-XC elements — Global Transaction Manager, Coordinator and Datanode
  3. How to design a Postgres-XC cluster — cluster configuration and table design
  4. Build and installation
  5. How to configure Postgres-XC
  6. How to test Postgres-XC
  7. Cluster-wide backup and restore
  8. High availability and component failure
  9. Postgres-XC as a community, be a developer!

Well, to be honest, 3 hours is short for a tutorial that would need a full course of 2 days. So we are planning to have some demos running during the presentation, but for sure we will not be able to show as much as we wish during this short time.
So, you, who is reading this post and will of course participate in Postgres-XC tutorial at PGCon, what do you expect from this tutorial? Are there things you would like to see more than others based on the guidelines written above?

Feel free to post your opinions here, we’ll try to take into account everybody’s viewpoint!

In one word, Arch Linux is AWESOME. It is the first distribution of Linux that I use giving me the feeling that I control everything in my environment. Among its strengths, its package manager pacman makes everything very flexible and once you migrate to it, you don’t need to worry about support time or anything like for Ubuntu distributions or most of the major distributions.

However setting up an Arch environment is honestly a pain for noobs.
So, based on my *painful* experience, I created some manuals that can be used to install an ArchLinux environment using XFCE as Desktop.
So here is the list of manuals.

Those manuals are not perfect, but give good guidelines of my migration experience. Enjoy!

Postgres-XC, write-scalable multi-master symetric cluster based on PostgreSQL, version XC 1.0beta1 has been released.
This beta version is based on PostgreSQL 9.1beta2, and all the fixes of PostgreSQL 9.1 stable branch will be backported in Postgres-XC 1.0 stabilized version.
It is under PostgreSQL license.

You can download the binary directly from here.
This tarball includes all the HTML and man documentation.

A PDF file containing all the references is also available here: Reference PDF.

Compared to version 0.9.7, the following features have been added:

  • Fast query shipping (FQS), quick identification of expressions in a query that can be pushed down to remote nodes
  • SERIAL types
  • TABLESPACE
  • Utility to clean up 2PC transactions in cluster (pgxc_clean)
  • Utility for initialization of GTM (global transaction manager, utility called initgtm)
  • Relation-size functions
  • Regression stabilization

The project can be followed on Source Forge.
And we use a couple of GIT repositories for development:

Postgres-XC tutorial at PGCon in Ottawa this May will use a 1.0 version, so be sure to touch this beta version to have an idea of what is Postgres-XC before coming!
Since the last release, a special effort has been made on stabilization and performance improvement, but be sure to give your feedback in order to provide a stable 1.0 release for PostgreSQL community.

© 2012 Michael Paquier All content is ©Copyright of Otacoo.com 2010-2012. Privacy Policy - Terms of Use