Christopher Browne cbbrowne at ca.afilias.info
Tue Jul 21 15:46:02 PDT 2009
Laurent Laborde <kerdezixe at gmail.com> writes:
> On Tue, Jul 14, 2009 at 7:07 PM, Christopher
> Browne<cbbrowne at ca.afilias.info> wrote:
>> Kenneth Marshall <ktm at rice.edu> writes:
>>> In particular, I would like to be able to upgrade an
>>> 8.3 databae to 8.4 with minimal downtime. 1.2.14 does
>>> not build with a missing function definition for
>>> SerializableSnapshot. If not, is there a scheme to
>>> upgrade to 8.4 that does not entail the outage of
>>> a full dump/restore cycle?
>>
>> No, 1.2 does not work with 8.4, and barring having considerably more
>> time to play with, it doesn't seem like a straightforward backport.
>>
>> There were substantial changes in 8.4 to the implementation of
>> pg_listener, to change from on-table storage to an in-memory handling
>> that would fairly much break the whole listener loop.
>>
>> Version 2.0 revised that substantially; that doesn't seem like a
>> backport, though.
>
> This is really a major problem.
> upgrade to slony-1 2.x require to rebuild the whole cluster.
> upgrade to pgsql-8.4 require to rebuild the whole database.
>
> I cannot find a way to upgrade to 8.4 without innaceptable downtime
> unless we upgrade both psql and slony at once :(

In view of the "noise", I'm taking a look at how challenging it is to
get 8.4 support into the 1.2 branch...

In the initial "browse," I'm seeing two places that are affected by
SerializableSnapshot...

 - xxid.c has a couple of references.

          From the remedying that took place in the 2.0 branch, this
          looks not overly scary; if I augment autoconf to detect
          whether or not we have GetActiveSnapshot(), then the same
          strategy used in src/slony1_funcs.c looks like it should
          resolve this fairly easily.

 - slony1_funcs.c has rather more references.

          Some seem readily addressed as above.

          Unfortunately, the function _Slony_I_createEvent() seems to
          be quite substantially different between 1.2 and 2.0,
          relating to some things that do seem to refer to
          SerializableSnapshot...

    Notably, the following whole fragment is no longer in 2.0, and
    doesn't seem to "translate."

	/*
	 * Build the comma separated list of transactions in progress as Text
	 * datum.
	 */
	*(cp = buf) = '\0';
	for (xcnt = 0; xcnt < SerializableSnapshot->xcnt; xcnt++)
	{
		if ((cp + 30) >= (buf + buf_size))
		{
			buf_size *= 2;
			buf = repalloc(buf, buf_size);
			cp = buf + strlen(buf);
		}
		sprintf(cp, "%s'%u'", (xcnt > 0) ? "," : "",
				SerializableSnapshot->xip[xcnt]);
		cp += strlen(cp);
	}
	ev_xip = DatumGetTextP(DirectFunctionCall1(textin, PointerGetDatum(buf)));
	/*
	 * Call the saved INSERT plan
	 */
	argv[0] = TransactionIdGetDatum(SerializableSnapshot->xmin);
	argv[1] = TransactionIdGetDatum(SerializableSnapshot->xmax);
	argv[2] = PointerGetDatum(ev_xip);
	nulls[0] = ' ';
	nulls[1] = ' ';
	nulls[2] = ' ';

There's another pretty visible 8.4 issue...  src/slon/cleanup_thread.c
has a reference to pg_autovacuum.

I think that one will not be grossly difficult to work around; I
puzzled thru this today for the 2.0 branch, and it was not overly
troublesome.  It'll be uglier for 1.2, but it should not be horrible.

We now *do* have a strategy for getting a quick + clean upgrade from
1.2 to 2.0, once one is on 8.3 or 8.4.  But I fully agree with you
that there's an ugly amount of upgrading that the current version
upgrade choices forces onto you.

You can't have version 2.0 without being on 8.3 or 8.4; that's a
*given* :-).

But it seems like rather a bad thing to force someone who wants to
upgrade to 8.4 to *also* do a full cluster upgrade to 8.3 just because
Slony-I 1.2 doesn't support 8.4.  If it's not *grossly* difficult, 

Jan, can you comment particularly on the
slony1_funcs.c/SerializableSnapshot bits, please?
-- 
(reverse (concatenate 'string "ofni.secnanifxunil" "@" "enworbbc"))
http://linuxdatabases.info/info/lisp.html
"I support Microsoft's right to innovate.  I just wish they would make
use of that right." - Steve Shaw


More information about the Slony1-general mailing list