From dc267149eb7c4adadf415fb184f7c8f3072d8d10 Mon Sep 17 00:00:00 2001 From: Jan Wieck Date: Fri, 14 Oct 2011 17:27:12 -0400 Subject: [PATCH 1/7] Parts 1, 2 and 3 of the 2.2 copy-protocol changes. 1) Change the sl_log_N tables adding columns for the table schema and name; Add a special column for update actions, containing the number of updated columns for the SET clause; Change log_cmddata into log_cmdargs of type text[]. This includes a check script in the ./tools directory that can be used to verify that a cluster is completely caught up as well as the changes to upgradeSchema() to change the sl_log_N format during a Slony version upgrade. This worked for a 2.0 -> 2.2 upgrade. Still needs documentation of the upgrade procedure. 2) Adjust the log triggers to produce the new log format. 3) Remove the slon remote_worker code that updates the replicated user tables. The above changes broke that part anyway and this allows for an apply trigger to take over the work of applying data changes. extra) Added a PL/pgSQL implementation of the apply trigger. This results in a fully functional slony system again and acts as a proof of concept. --- clustertest/conf/slon.1.conf.sample | 14 - clustertest/conf/slon.2.conf.sample | 14 - clustertest/conf/slon.3.conf.sample | 14 - clustertest/conf/slon.4.conf.sample | 14 - clustertest/conf/slon.5.conf.sample | 14 - doc/adminguide/loganalysis.sgml | 3 - doc/adminguide/slonconf.sgml | 39 --- share/slon.conf-sample | 16 +- src/backend/slony1_base.sql | 35 ++- src/backend/slony1_funcs.c | 436 ++++++++-------------------- src/backend/slony1_funcs.sql | 347 +++++++++++++++++++++- src/slon/confoptions.c | 24 -- src/slon/confoptions.h | 2 - src/slon/remote_worker.c | 219 +++----------- src/slon/slon.h | 2 - tests/run_test.sh | 2 - tools/check_unconfirmed_log.sh | 94 ++++++ tools/mkservice/slon-mkservice.sh | 14 - tools/mkslonconf.sh | 14 - 19 files changed, 605 insertions(+), 712 deletions(-) create mode 100644 tools/check_unconfirmed_log.sh diff --git a/clustertest/conf/slon.1.conf.sample b/clustertest/conf/slon.1.conf.sample index a4e834a8..43b94f2f 100644 --- a/clustertest/conf/slon.1.conf.sample +++ b/clustertest/conf/slon.1.conf.sample @@ -35,20 +35,6 @@ sync_interval_timeout=2000 # Range: [0,100], default: 6 sync_group_maxsize=5 -# Size above which an sl_log_? row's log_cmddata is considered large. -# Up to 500 rows of this size are allowed in memory at once. Rows larger -# than that count into the sync_max_largemem space allocated and free'd -# on demand. -# Range: [1024,32768], default: 8192 -sync_max_rowsize=16384 - -# Maximum amount of memory allowed for large rows. Note that the algorithm -# will stop fetching rows AFTER this amount is exceeded, not BEFORE. This -# is done to ensure that a single row exceeding this limit alone does not -# stall replication. -# Range: [1048576,1073741824], default: 5242880 -sync_max_largemem=3276800 - # If this parameter is 1, messages go both to syslog and the standard # output. A value of 2 sends output only to syslog (some messages will # still go to the standard output/error). The default is 0, which means diff --git a/clustertest/conf/slon.2.conf.sample b/clustertest/conf/slon.2.conf.sample index a4e834a8..43b94f2f 100644 --- a/clustertest/conf/slon.2.conf.sample +++ b/clustertest/conf/slon.2.conf.sample @@ -35,20 +35,6 @@ sync_interval_timeout=2000 # Range: [0,100], default: 6 sync_group_maxsize=5 -# Size above which an sl_log_? row's log_cmddata is considered large. -# Up to 500 rows of this size are allowed in memory at once. Rows larger -# than that count into the sync_max_largemem space allocated and free'd -# on demand. -# Range: [1024,32768], default: 8192 -sync_max_rowsize=16384 - -# Maximum amount of memory allowed for large rows. Note that the algorithm -# will stop fetching rows AFTER this amount is exceeded, not BEFORE. This -# is done to ensure that a single row exceeding this limit alone does not -# stall replication. -# Range: [1048576,1073741824], default: 5242880 -sync_max_largemem=3276800 - # If this parameter is 1, messages go both to syslog and the standard # output. A value of 2 sends output only to syslog (some messages will # still go to the standard output/error). The default is 0, which means diff --git a/clustertest/conf/slon.3.conf.sample b/clustertest/conf/slon.3.conf.sample index a4e834a8..43b94f2f 100644 --- a/clustertest/conf/slon.3.conf.sample +++ b/clustertest/conf/slon.3.conf.sample @@ -35,20 +35,6 @@ sync_interval_timeout=2000 # Range: [0,100], default: 6 sync_group_maxsize=5 -# Size above which an sl_log_? row's log_cmddata is considered large. -# Up to 500 rows of this size are allowed in memory at once. Rows larger -# than that count into the sync_max_largemem space allocated and free'd -# on demand. -# Range: [1024,32768], default: 8192 -sync_max_rowsize=16384 - -# Maximum amount of memory allowed for large rows. Note that the algorithm -# will stop fetching rows AFTER this amount is exceeded, not BEFORE. This -# is done to ensure that a single row exceeding this limit alone does not -# stall replication. -# Range: [1048576,1073741824], default: 5242880 -sync_max_largemem=3276800 - # If this parameter is 1, messages go both to syslog and the standard # output. A value of 2 sends output only to syslog (some messages will # still go to the standard output/error). The default is 0, which means diff --git a/clustertest/conf/slon.4.conf.sample b/clustertest/conf/slon.4.conf.sample index a4e834a8..43b94f2f 100644 --- a/clustertest/conf/slon.4.conf.sample +++ b/clustertest/conf/slon.4.conf.sample @@ -35,20 +35,6 @@ sync_interval_timeout=2000 # Range: [0,100], default: 6 sync_group_maxsize=5 -# Size above which an sl_log_? row's log_cmddata is considered large. -# Up to 500 rows of this size are allowed in memory at once. Rows larger -# than that count into the sync_max_largemem space allocated and free'd -# on demand. -# Range: [1024,32768], default: 8192 -sync_max_rowsize=16384 - -# Maximum amount of memory allowed for large rows. Note that the algorithm -# will stop fetching rows AFTER this amount is exceeded, not BEFORE. This -# is done to ensure that a single row exceeding this limit alone does not -# stall replication. -# Range: [1048576,1073741824], default: 5242880 -sync_max_largemem=3276800 - # If this parameter is 1, messages go both to syslog and the standard # output. A value of 2 sends output only to syslog (some messages will # still go to the standard output/error). The default is 0, which means diff --git a/clustertest/conf/slon.5.conf.sample b/clustertest/conf/slon.5.conf.sample index a4e834a8..43b94f2f 100644 --- a/clustertest/conf/slon.5.conf.sample +++ b/clustertest/conf/slon.5.conf.sample @@ -35,20 +35,6 @@ sync_interval_timeout=2000 # Range: [0,100], default: 6 sync_group_maxsize=5 -# Size above which an sl_log_? row's log_cmddata is considered large. -# Up to 500 rows of this size are allowed in memory at once. Rows larger -# than that count into the sync_max_largemem space allocated and free'd -# on demand. -# Range: [1024,32768], default: 8192 -sync_max_rowsize=16384 - -# Maximum amount of memory allowed for large rows. Note that the algorithm -# will stop fetching rows AFTER this amount is exceeded, not BEFORE. This -# is done to ensure that a single row exceeding this limit alone does not -# stall replication. -# Range: [1048576,1073741824], default: 5242880 -sync_max_largemem=3276800 - # If this parameter is 1, messages go both to syslog and the standard # output. A value of 2 sends output only to syslog (some messages will # still go to the standard output/error). The default is 0, which means diff --git a/doc/adminguide/loganalysis.sgml b/doc/adminguide/loganalysis.sgml index 8761d9fd..3d129bc8 100644 --- a/doc/adminguide/loganalysis.sgml +++ b/doc/adminguide/loganalysis.sgml @@ -736,9 +736,6 @@ application downtime may not be necessary. This indicates how long it took to get the first row from the LOG cursor that pulls in data from the sl_log tables. -ERROR: remoteWorkerThread_%d_d: large log_cmddata for actionseq %s not found - - &lslon; could not find the data for one of the very large sl_log table tuples that are pulled individually. This shouldn't happen. DEBUG2: remoteWorkerThread_%d_d:%.3f seconds until close cursor This indicates how long it took to complete reading data from the LOG cursor that pulls in data from the sl_log tables. diff --git a/doc/adminguide/slonconf.sgml b/doc/adminguide/slonconf.sgml index abb96dfe..7ad0cc26 100644 --- a/doc/adminguide/slonconf.sgml +++ b/doc/adminguide/slonconf.sgml @@ -580,45 +580,6 @@ - - sync_max_rowsize (integer) - - sync_max_rowsize configuration parameter - - - Size above which an sl_log_? row's - log_cmddata is considered large. Up to 500 - rows of this size are allowed in memory at once. Rows larger - than that count into the sync_max_largemem - space allocated and free()'ed on demand. - - - The default value is 8192, meaning that your expected - memory consumption (for the LOG cursor) should not exceed 8MB. - - - - - - sync_max_largemem (integer) - - sync_max_largemem configuration parameter - - - Maximum memory allocated for large rows, where - log_cmddata are larger than - sync_max_rowsize. - - Note that the algorithm reads rows until - after this value is exceeded. Otherwise, - a tuple larger than this value would stall replication. As a - result, don't assume that memory consumption will remain - smaller than this value. - - - The default value is 5242880. - - remote_listen_timeout (integer) diff --git a/share/slon.conf-sample b/share/slon.conf-sample index 7bb9d4c3..433c6955 100644 --- a/share/slon.conf-sample +++ b/share/slon.conf-sample @@ -37,20 +37,6 @@ # Range: [0,100], default: 6 #sync_group_maxsize=6 -# Size above which an sl_log_? row's log_cmddata is considered large. -# Up to 500 rows of this size are allowed in memory at once. Rows larger -# than that count into the sync_max_largemem space allocated and free'd -# on demand. -# Range: [1024,32768], default: 8192 -#sync_max_rowsize=8192 - -# Maximum amount of memory allowed for large rows. Note that the algorithm -# will stop fetching rows AFTER this amount is exceeded, not BEFORE. This -# is done to ensure that a single row exceeding this limit alone does not -# stall replication. -# Range: [1048576,1073741824], default: 5242880 -#sync_max_largemem=5242880 - # If this parameter is 1, messages go both to syslog and the standard # output. A value of 2 sends output only to syslog (some messages will # still go to the standard output/error). The default is 0, which means @@ -117,4 +103,4 @@ # archive_dir="/tmp/somewhere" # Should slon run the monitoring thread? -# monitor_threads=true \ No newline at end of file +# monitor_threads=true diff --git a/src/backend/slony1_base.sql b/src/backend/slony1_base.sql index d82e69db..decb1041 100644 --- a/src/backend/slony1_base.sql +++ b/src/backend/slony1_base.sql @@ -369,8 +369,11 @@ create table @NAMESPACE@.sl_log_1 ( log_txid bigint, log_tableid int4, log_actionseq int8, + log_tablenspname text, + log_tablerelname text, log_cmdtype char, - log_cmddata text + log_cmdupdncols int4, + log_cmdargs text[] ) WITHOUT OIDS; create index sl_log_1_idx1 on @NAMESPACE@.sl_log_1 (log_origin, log_txid, log_actionseq); @@ -383,8 +386,12 @@ comment on table @NAMESPACE@.sl_log_1 is 'Stores each change to be propagated to comment on column @NAMESPACE@.sl_log_1.log_origin is 'Origin node from which the change came'; comment on column @NAMESPACE@.sl_log_1.log_txid is 'Transaction ID on the origin node'; comment on column @NAMESPACE@.sl_log_1.log_tableid is 'The table ID (from sl_table.tab_id) that this log entry is to affect'; -comment on column @NAMESPACE@.sl_log_1.log_cmdtype is 'Replication action to take. U = Update, I = Insert, D = DELETE'; -comment on column @NAMESPACE@.sl_log_1.log_cmddata is 'The data needed to perform the log action'; +comment on column @NAMESPACE@.sl_log_1.log_actionseq is 'The sequence number in which actions will be applied on replicas'; +comment on column @NAMESPACE@.sl_log_1.log_tablenspname is 'The schema name of the table affected'; +comment on column @NAMESPACE@.sl_log_1.log_tablerelname is 'The table name of the table affected'; +comment on column @NAMESPACE@.sl_log_1.log_cmdtype is 'Replication action to take. U = Update, I = Insert, D = DELETE, T = TRUNCATE'; +comment on column @NAMESPACE@.sl_log_1.log_cmdupdncols is 'For cmdtype=U the number of updated columns in cmdargs'; +comment on column @NAMESPACE@.sl_log_1.log_cmdargs is 'The data needed to perform the log action on the replica'; -- ---------------------------------------------------------------------- -- TABLE sl_log_2 @@ -394,15 +401,12 @@ create table @NAMESPACE@.sl_log_2 ( log_txid bigint, log_tableid int4, log_actionseq int8, + log_tablenspname text, + log_tablerelname text, log_cmdtype char, - log_cmddata text + log_cmdupdncols int4, + log_cmdargs text[] ) WITHOUT OIDS; -comment on table @NAMESPACE@.sl_log_2 is 'Stores each change to be propagated to subscriber nodes'; -comment on column @NAMESPACE@.sl_log_2.log_origin is 'Origin node from which the change came'; -comment on column @NAMESPACE@.sl_log_2.log_txid is 'Transaction ID on the origin node'; -comment on column @NAMESPACE@.sl_log_2.log_tableid is 'The table ID (from sl_table.tab_id) that this log entry is to affect'; -comment on column @NAMESPACE@.sl_log_2.log_cmdtype is 'Replication action to take. U = Update, I = Insert, D = DELETE'; -comment on column @NAMESPACE@.sl_log_2.log_cmddata is 'The data needed to perform the log action'; create index sl_log_2_idx1 on @NAMESPACE@.sl_log_2 (log_origin, log_txid, log_actionseq); @@ -410,6 +414,17 @@ create index sl_log_2_idx1 on @NAMESPACE@.sl_log_2 -- create index sl_log_2_idx2 on @NAMESPACE@.sl_log_2 -- (log_txid); +comment on table @NAMESPACE@.sl_log_2 is 'Stores each change to be propagated to subscriber nodes'; +comment on column @NAMESPACE@.sl_log_2.log_origin is 'Origin node from which the change came'; +comment on column @NAMESPACE@.sl_log_2.log_txid is 'Transaction ID on the origin node'; +comment on column @NAMESPACE@.sl_log_2.log_tableid is 'The table ID (from sl_table.tab_id) that this log entry is to affect'; +comment on column @NAMESPACE@.sl_log_2.log_actionseq is 'The sequence number in which actions will be applied on replicas'; +comment on column @NAMESPACE@.sl_log_2.log_tablenspname is 'The schema name of the table affected'; +comment on column @NAMESPACE@.sl_log_2.log_tablerelname is 'The table name of the table affected'; +comment on column @NAMESPACE@.sl_log_2.log_cmdtype is 'Replication action to take. U = Update, I = Insert, D = DELETE, T = TRUNCATE'; +comment on column @NAMESPACE@.sl_log_2.log_cmdupdncols is 'For cmdtype=U the number of updated columns in cmdargs'; +comment on column @NAMESPACE@.sl_log_2.log_cmdargs is 'The data needed to perform the log action on the replica'; + -- ---------------------------------------------------------------------- -- TABLE sl_registry diff --git a/src/backend/slony1_funcs.c b/src/backend/slony1_funcs.c index 9f5c06c4..cad7b512 100644 --- a/src/backend/slony1_funcs.c +++ b/src/backend/slony1_funcs.c @@ -36,6 +36,7 @@ #include "utils/guc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/lsyscache.h" #ifdef HAVE_GETACTIVESNAPSHOT #include "utils/snapmgr.h" #endif @@ -119,9 +120,6 @@ typedef struct slony_I_cluster_status text *cmdtype_U; text *cmdtype_D; - text *cmddata_buf; - int cmddata_size; - struct slony_I_cluster_status *next; } Slony_I_ClusterStatus; @@ -131,7 +129,6 @@ static Slony_I_ClusterStatus * getClusterStatus(Name cluster_name, int need_plan_mask); static const char *slon_quote_identifier(const char *ident); -static char *slon_quote_literal(char *str); static int prepareLogPlan(Slony_I_ClusterStatus * cs, int log_status); @@ -287,14 +284,22 @@ _Slony_I_logTrigger(PG_FUNCTION_ARGS) TransactionId newXid = GetTopTransactionId(); Slony_I_ClusterStatus *cs; TriggerData *tg; - Datum argv[4]; + Datum argv[6]; text *cmdtype = NULL; + int32 cmdupdncols = 0; int rc; Name cluster_name; int32 tab_id; char *attkind; int attkind_idx; - int cmddata_need; + + char *olddatestyle = NULL; + Datum *cmdargs = NULL; + Datum *cmdargselem = NULL; + bool *cmdnulls = NULL; + bool *cmdnullselem = NULL; + int cmddims[1]; + int cmdlbs[1]; /* * Don't do any logging if the current session role isn't Origin. @@ -379,35 +384,41 @@ _Slony_I_logTrigger(PG_FUNCTION_ARGS) cs->currentXid = newXid; } + /* + * Save the current datestyle setting and switch to ISO (if not already) + */ + olddatestyle = GetConfigOptionByName("DateStyle", NULL); + if (!strstr(olddatestyle, "ISO")) + set_config_option("DateStyle", "ISO", PGC_USERSET, PGC_S_SESSION, + true, true); + /* - * Determine cmdtype and cmddata depending on the command type + * Determine cmdtype and cmdargs depending on the command type */ if (TRIGGER_FIRED_BY_INSERT(tg->tg_event)) { HeapTuple new_row = tg->tg_trigtuple; TupleDesc tupdesc = tg->tg_relation->rd_att; - char *col_ident; char *col_value; - int len_ident; - int len_value; int i; - int need_comma = false; - char *OldDateStyle; - char *cp = VARDATA(cs->cmddata_buf); /* * INSERT * - * cmdtype = 'I' cmddata = ("col" [, ...]) values ('value' [, ...]) + * cmdtype = 'I' cmdargs = colname, newval [, ...] */ cmdtype = cs->cmdtype_I; + cmdargselem = cmdargs = (Datum *)palloc(sizeof(Datum) * + ((tg->tg_relation->rd_att->natts * 2) + 2)); + cmdnullselem = cmdnulls = (bool *)palloc(sizeof(bool) * + ((tg->tg_relation->rd_att->natts * 2) + 2)); + /* * Specify all the columns */ - *cp++ = '('; for (i = 0; i < tg->tg_relation->rd_att->natts; i++) { /* @@ -416,98 +427,28 @@ _Slony_I_logTrigger(PG_FUNCTION_ARGS) if (tupdesc->attrs[i]->attisdropped) continue; - col_ident = (char *) slon_quote_identifier(SPI_fname(tupdesc, i + 1)); - cmddata_need = (cp - (char *) (cs->cmddata_buf)) + 16 + - (len_ident = strlen(col_ident)); - if (cs->cmddata_size < cmddata_need) - { - int have = (cp - (char *) (cs->cmddata_buf)); - - while (cs->cmddata_size < cmddata_need) - cs->cmddata_size *= 2; - cs->cmddata_buf = realloc(cs->cmddata_buf, cs->cmddata_size); - cp = (char *) (cs->cmddata_buf) + have; - } - - if (need_comma) - *cp++ = ','; - else - need_comma = true; - - memcpy(cp, col_ident, len_ident); - cp += len_ident; - } - - /* - * Append the string ") values (" - */ - *cp++ = ')'; - *cp++ = ' '; - *cp++ = 'v'; - *cp++ = 'a'; - *cp++ = 'l'; - *cp++ = 'u'; - *cp++ = 'e'; - *cp++ = 's'; - *cp++ = ' '; - *cp++ = '('; - - /* - * Append the values - */ - need_comma = false; - OldDateStyle = GetConfigOptionByName("DateStyle", NULL); - if (!strstr(OldDateStyle, "ISO")) - set_config_option("DateStyle", "ISO", PGC_USERSET, PGC_S_SESSION, true, true); - for (i = 0; i < tg->tg_relation->rd_att->natts; i++) - { /* - * Skip dropped columns + * Add the column name */ - if (tupdesc->attrs[i]->attisdropped) - continue; - + *cmdargselem++ = DirectFunctionCall1(textin, + CStringGetDatum(SPI_fname(tupdesc, i + 1))); + *cmdnullselem++ = false; + /* + * Add the column value + */ if ((col_value = SPI_getvalue(new_row, tupdesc, i + 1)) == NULL) { - col_value = "NULL"; + *cmdnullselem++ = true; } else { - col_value = slon_quote_literal(col_value); + *cmdargselem++ = DirectFunctionCall1(textin, + CStringGetDatum(col_value)); + *cmdnullselem++ = false; } - - cmddata_need = (cp - (char *) (cs->cmddata_buf)) + 16 + - (len_value = strlen(col_value)); - if (cs->cmddata_size < cmddata_need) - { - int have = (cp - (char *) (cs->cmddata_buf)); - - while (cs->cmddata_size < cmddata_need) - cs->cmddata_size *= 2; - cs->cmddata_buf = realloc(cs->cmddata_buf, cs->cmddata_size); - cp = (char *) (cs->cmddata_buf) + have; - } - - if (need_comma) - *cp++ = ','; - else - need_comma = true; - - memcpy(cp, col_value, len_value); - cp += len_value; } - if (!strstr(OldDateStyle, "ISO")) - set_config_option("DateStyle", OldDateStyle, PGC_USERSET, PGC_S_SESSION, true, true); - - /* - * Terminate and done - */ - *cp++ = ')'; - *cp = '\0'; - SET_VARSIZE(cs->cmddata_buf, - VARHDRSZ + (cp - VARDATA(cs->cmddata_buf))); } else if (TRIGGER_FIRED_BY_UPDATE(tg->tg_event)) { @@ -521,22 +462,24 @@ _Slony_I_logTrigger(PG_FUNCTION_ARGS) char *col_ident; char *col_value; - int len_ident; - int len_value; int i; - int need_comma = false; - int need_and = false; - char *OldDateStyle; - - char *cp = VARDATA(cs->cmddata_buf); /* * UPDATE * - * cmdtype = 'U' cmddata = "col_ident"='value' [, ...] where - * "pk_ident" = 'value' [ and ...] + * cmdtype = 'U' cmdargs = pkcolname, oldval [, ...] + * colname, newval [, ...] */ cmdtype = cs->cmdtype_U; + + cmdargselem = cmdargs = (Datum *)palloc(sizeof(Datum) * + ((tg->tg_relation->rd_att->natts * 4) + 3)); + cmdnullselem = cmdnulls = (bool *)palloc(sizeof(bool) * + ((tg->tg_relation->rd_att->natts * 4) + 3)); + + /* + * For all changed columns, add name+value pairs and count them. + */ for (i = 0; i < tg->tg_relation->rd_att->natts; i++) { /* @@ -612,95 +555,23 @@ _Slony_I_logTrigger(PG_FUNCTION_ARGS) } } - if (need_comma) - *cp++ = ','; - else - need_comma = true; - - col_ident = (char *) slon_quote_identifier(SPI_fname(tupdesc, i + 1)); + *cmdargselem++ = DirectFunctionCall1(textin, + CStringGetDatum(SPI_fname(tupdesc, i + 1))); + *cmdnullselem++ = false; if (new_isnull) - col_value = "NULL"; + *cmdnullselem++ = true; else { - OldDateStyle = GetConfigOptionByName("DateStyle", NULL); - if (!strstr(OldDateStyle, "ISO")) - set_config_option("DateStyle", "ISO", PGC_USERSET, PGC_S_SESSION, true, true); - col_value = slon_quote_literal(SPI_getvalue(new_row, tupdesc, i + 1)); - if (!strstr(OldDateStyle, "ISO")) - set_config_option("DateStyle", OldDateStyle, PGC_USERSET, PGC_S_SESSION, true, true); + *cmdargselem++ = DirectFunctionCall1(textin, + CStringGetDatum(SPI_getvalue(new_row, tupdesc, i + 1))); + *cmdnullselem++ = false; } - cmddata_need = (cp - (char *) (cs->cmddata_buf)) + 16 + - (len_ident = strlen(col_ident)) + - (len_value = strlen(col_value)); - if (cs->cmddata_size < cmddata_need) - { - int have = (cp - (char *) (cs->cmddata_buf)); - - while (cs->cmddata_size < cmddata_need) - cs->cmddata_size *= 2; - cs->cmddata_buf = realloc(cs->cmddata_buf, cs->cmddata_size); - cp = (char *) (cs->cmddata_buf) + have; - } - - memcpy(cp, col_ident, len_ident); - cp += len_ident; - *cp++ = '='; - memcpy(cp, col_value, len_value); - cp += len_value; + cmdupdncols++; } /* - * It can happen that the only UPDATE an application does is to set a - * column to the same value again. In that case, we'd end up here with - * no columns in the SET clause yet. We add the first key column here - * with it's old value to simulate the same for the replication - * engine. + * Add pairs of PK column names and values */ - if (!need_comma) - { - for (i = 0, attkind_idx = -1; i < tg->tg_relation->rd_att->natts; i++) - { - if (tupdesc->attrs[i]->attisdropped) - continue; - - attkind_idx++; - if (!attkind[attkind_idx]) - elog(ERROR, "Slony-I: no key columns found in logTrigger() attkind parameter"); - - if (attkind[attkind_idx] == 'k') - break; - } - col_ident = (char *) slon_quote_identifier(SPI_fname(tupdesc, i + 1)); - col_value = slon_quote_literal(SPI_getvalue(old_row, tupdesc, i + 1)); - - cmddata_need = (cp - (char *) (cs->cmddata_buf)) + 16 + - (len_ident = strlen(col_ident)) + - (len_value = strlen(col_value)); - if (cs->cmddata_size < cmddata_need) - { - int have = (cp - (char *) (cs->cmddata_buf)); - - while (cs->cmddata_size < cmddata_need) - cs->cmddata_size *= 2; - cs->cmddata_buf = realloc(cs->cmddata_buf, cs->cmddata_size); - cp = (char *) (cs->cmddata_buf) + have; - } - - memcpy(cp, col_ident, len_ident); - cp += len_ident; - *cp++ = '='; - memcpy(cp, col_value, len_value); - cp += len_value; - } - - *cp++ = ' '; - *cp++ = 'w'; - *cp++ = 'h'; - *cp++ = 'e'; - *cp++ = 'r'; - *cp++ = 'e'; - *cp++ = ' '; - for (i = 0, attkind_idx = -1; i < tg->tg_relation->rd_att->natts; i++) { /* @@ -714,45 +585,21 @@ _Slony_I_logTrigger(PG_FUNCTION_ARGS) break; if (attkind[attkind_idx] != 'k') continue; - col_ident = (char *) slon_quote_identifier(SPI_fname(tupdesc, i + 1)); - col_value = slon_quote_literal(SPI_getvalue(old_row, tupdesc, i + 1)); + col_ident = SPI_fname(tupdesc, i + 1); + col_value = SPI_getvalue(old_row, tupdesc, i + 1); if (col_value == NULL) elog(ERROR, "Slony-I: old key column %s.%s IS NULL on UPDATE", NameStr(tg->tg_relation->rd_rel->relname), col_ident); - cmddata_need = (cp - (char *) (cs->cmddata_buf)) + 16 + - (len_ident = strlen(col_ident)) + - (len_value = strlen(col_value)); - if (cs->cmddata_size < cmddata_need) - { - int have = (cp - (char *) (cs->cmddata_buf)); - - while (cs->cmddata_size < cmddata_need) - cs->cmddata_size *= 2; - cs->cmddata_buf = realloc(cs->cmddata_buf, cs->cmddata_size); - cp = (char *) (cs->cmddata_buf) + have; - } - - if (need_and) - { - *cp++ = ' '; - *cp++ = 'a'; - *cp++ = 'n'; - *cp++ = 'd'; - *cp++ = ' '; - } - else - need_and = true; + *cmdargselem++ = DirectFunctionCall1(textin, + CStringGetDatum(col_ident)); + *cmdnullselem++ = false; - memcpy(cp, col_ident, len_ident); - cp += len_ident; - *cp++ = '='; - memcpy(cp, col_value, len_value); - cp += len_value; + *cmdargselem++ = DirectFunctionCall1(textin, + CStringGetDatum(col_value)); + *cmdnullselem++ = false; } - *cp = '\0'; - SET_VARSIZE(cs->cmddata_buf, - VARHDRSZ + (cp - VARDATA(cs->cmddata_buf))); + } else if (TRIGGER_FIRED_BY_DELETE(tg->tg_event)) { @@ -760,19 +607,23 @@ _Slony_I_logTrigger(PG_FUNCTION_ARGS) TupleDesc tupdesc = tg->tg_relation->rd_att; char *col_ident; char *col_value; - int len_ident; - int len_value; int i; - int need_and = false; - char *cp = VARDATA(cs->cmddata_buf); /* * DELETE * - * cmdtype = 'D' cmddata = "pk_ident"='value' [and ...] + * cmdtype = 'D' cmdargs = pkcolname, oldval [, ...] */ cmdtype = cs->cmdtype_D; + cmdargselem = cmdargs = (Datum *)palloc(sizeof(Datum) * + ((tg->tg_relation->rd_att->natts * 2) + 2)); + cmdnullselem = cmdnulls = (bool *)palloc(sizeof(bool) * + ((tg->tg_relation->rd_att->natts * 2) + 2)); + + /* + * Add the PK columns + */ for (i = 0, attkind_idx = -1; i < tg->tg_relation->rd_att->natts; i++) { if (tupdesc->attrs[i]->attisdropped) @@ -783,55 +634,47 @@ _Slony_I_logTrigger(PG_FUNCTION_ARGS) break; if (attkind[attkind_idx] != 'k') continue; - col_ident = (char *) slon_quote_identifier(SPI_fname(tupdesc, i + 1)); - col_value = slon_quote_literal(SPI_getvalue(old_row, tupdesc, i + 1)); + + *cmdargselem++ = DirectFunctionCall1(textin, + CStringGetDatum(col_ident = SPI_fname(tupdesc, i + 1))); + *cmdnullselem++ = false; + + col_value = SPI_getvalue(old_row, tupdesc, i + 1); if (col_value == NULL) elog(ERROR, "Slony-I: old key column %s.%s IS NULL on DELETE", NameStr(tg->tg_relation->rd_rel->relname), col_ident); - - cmddata_need = (cp - (char *) (cs->cmddata_buf)) + 16 + - (len_ident = strlen(col_ident)) + - (len_value = strlen(col_value)); - if (cs->cmddata_size < cmddata_need) - { - int have = (cp - (char *) (cs->cmddata_buf)); - - while (cs->cmddata_size < cmddata_need) - cs->cmddata_size *= 2; - cs->cmddata_buf = realloc(cs->cmddata_buf, cs->cmddata_size); - cp = (char *) (cs->cmddata_buf) + have; - } - - if (need_and) - { - *cp++ = ' '; - *cp++ = 'a'; - *cp++ = 'n'; - *cp++ = 'd'; - *cp++ = ' '; - } - else - need_and = true; - - memcpy(cp, col_ident, len_ident); - cp += len_ident; - *cp++ = '='; - memcpy(cp, col_value, len_value); - cp += len_value; + *cmdargselem++ = DirectFunctionCall1(textin, + CStringGetDatum(col_value)); + *cmdnullselem++ = false; } - *cp = '\0'; - SET_VARSIZE(cs->cmddata_buf, - VARHDRSZ + (cp - VARDATA(cs->cmddata_buf))); } else elog(ERROR, "Slony-I: logTrigger() fired for unhandled event"); + /* + * Restore the datestyle + */ + if (!strstr(olddatestyle, "ISO")) + set_config_option("DateStyle", olddatestyle, + PGC_USERSET, PGC_S_SESSION, true, true); + /* * Construct the parameter array and insert the log row. */ + cmddims[0] = cmdargselem - cmdargs; + cmdlbs[0] = 1; + argv[0] = Int32GetDatum(tab_id); - argv[1] = PointerGetDatum(cmdtype); - argv[2] = PointerGetDatum(cs->cmddata_buf); + argv[1] = DirectFunctionCall1(textin, + CStringGetDatum(get_namespace_name( + RelationGetNamespace(tg->tg_relation)))); + argv[2] = DirectFunctionCall1(textin, + CStringGetDatum(RelationGetRelationName(tg->tg_relation))); + argv[3] = PointerGetDatum(cmdtype); + argv[4] = Int32GetDatum(cmdupdncols); + argv[5] = PointerGetDatum(construct_md_array(cmdargs, cmdnulls, 1, + cmddims, cmdlbs, TEXTOID, -1, false, 'i')); + SPI_execp(cs->plan_active_log, argv, NULL, 0); SPI_finish(); @@ -1018,50 +861,6 @@ _Slony_I_seqtrack(PG_FUNCTION_ARGS) } -static char * -slon_quote_literal(char *str) -{ - char *result; - char *cp1; - char *cp2; - int len; - int wl; - - if (str == NULL) - return NULL; - - len = strlen(str); - result = palloc(len * 2 + 3); - cp1 = str; - cp2 = result; - - *cp2++ = '\''; - while (len > 0) - { - if ((wl = pg_mblen((const char *) cp1)) != 1) - { - len -= wl; - - while (wl-- > 0) - *cp2++ = *cp1++; - continue; - } - - if (*cp1 == '\'') - *cp2++ = '\''; - if (*cp1 == '\\') - *cp2++ = '\\'; - *cp2++ = *cp1++; - len--; - } - - *cp2++ = '\''; - *cp2++ = '\0'; - - return result; -} - - /* * slon_quote_identifier - Quote an identifier only if needed * @@ -1342,7 +1141,7 @@ getClusterStatus(Name cluster_name, int need_plan_mask) /* * Also create the 3 rather static text values for the log_cmdtype - * parameter and initialize the cmddata_buf. + * parameter. */ cs->cmdtype_I = malloc(VARHDRSZ + 1); SET_VARSIZE(cs->cmdtype_I, VARHDRSZ + 1); @@ -1361,9 +1160,6 @@ getClusterStatus(Name cluster_name, int need_plan_mask) cs->clusterident); cs->plan_get_logstatus = SPI_saveplan(SPI_prepare(query, 0, NULL)); - cs->cmddata_size = 8192; - cs->cmddata_buf = (text *) malloc(8192); - cs->have_plan |= PLAN_INSERT_LOG_STATUS; } @@ -1391,15 +1187,19 @@ int prepareLogPlan(Slony_I_ClusterStatus * cs, */ sprintf(query, "INSERT INTO %s.sl_log_1 " "(log_origin, log_txid, log_tableid, log_actionseq," - " log_cmdtype, log_cmddata) " + " log_tablenspname, log_tablerelname, " + " log_cmdtype, log_cmdupdncols, log_cmdargs) " "VALUES (%d, \"pg_catalog\".txid_current(), $1, " - "nextval('%s.sl_action_seq'), $2, $3); ", + "nextval('%s.sl_action_seq'), $2, $3, $4, $5, $6); ", cs->clusterident, cs->localNodeId, cs->clusterident); plan_types[0] = INT4OID; plan_types[1] = TEXTOID; plan_types[2] = TEXTOID; + plan_types[3] = TEXTOID; + plan_types[4] = INT4OID; + plan_types[5] = TEXTARRAYOID; - cs->plan_insert_log_1 = SPI_saveplan(SPI_prepare(query, 3, plan_types)); + cs->plan_insert_log_1 = SPI_saveplan(SPI_prepare(query, 6, plan_types)); if (cs->plan_insert_log_1 == NULL) elog(ERROR, "Slony-I: SPI_prepare() failed"); } @@ -1409,15 +1209,19 @@ int prepareLogPlan(Slony_I_ClusterStatus * cs, { sprintf(query, "INSERT INTO %s.sl_log_2 " "(log_origin, log_txid, log_tableid, log_actionseq," - " log_cmdtype, log_cmddata) " + " log_tablenspname, log_tablerelname, " + " log_cmdtype, log_cmdupdncols, log_cmdargs) " "VALUES (%d, \"pg_catalog\".txid_current(), $1, " - "nextval('%s.sl_action_seq'), $2, $3); ", + "nextval('%s.sl_action_seq'), $2, $3, $4, $5, $6); ", cs->clusterident, cs->localNodeId, cs->clusterident); plan_types[0] = INT4OID; plan_types[1] = TEXTOID; plan_types[2] = TEXTOID; + plan_types[3] = TEXTOID; + plan_types[4] = INT4OID; + plan_types[5] = TEXTARRAYOID; - cs->plan_insert_log_2 = SPI_saveplan(SPI_prepare(query, 3, plan_types)); + cs->plan_insert_log_2 = SPI_saveplan(SPI_prepare(query, 6, plan_types)); if (cs->plan_insert_log_2 == NULL) elog(ERROR, "Slony-I: SPI_prepare() failed"); } @@ -1446,8 +1250,6 @@ _Slony_I_resetSession(PG_FUNCTION_ARGS) free(cs->cmdtype_D); if(cs->cmdtype_U) free(cs->cmdtype_D); - if(cs->cmddata_buf) - free(cs->cmddata_buf); free(cs->clusterident); if(cs->plan_insert_event) SPI_freeplan(cs->plan_insert_event); diff --git a/src/backend/slony1_funcs.sql b/src/backend/slony1_funcs.sql index fc9d8a72..fd0a792d 100644 --- a/src/backend/slony1_funcs.sql +++ b/src/backend/slony1_funcs.sql @@ -4996,19 +4996,27 @@ system switches between sl_log_1 and sl_log_2.'; -- -- Called by slonik during the function upgrade process. -- ---------------------------------------------------------------------- +create or replace function @NAMESPACE@.check_table_field_exists (p_namespace text, p_table text, p_field text) +returns bool as $$ +BEGIN + return exists ( + select 1 from "information_schema".columns + where table_schema = p_namespace + and table_name = p_table + and column_name = p_field + ); +END;$$ language plpgsql; + +comment on function @NAMESPACE@.check_table_field_exists (p_namespace text, p_table text, p_field text) +is 'Check if a table has a specific attribute'; + create or replace function @NAMESPACE@.add_missing_table_field (p_namespace text, p_table text, p_field text, p_type text) returns bool as $$ DECLARE v_row record; v_query text; BEGIN - select 1 into v_row from pg_namespace n, pg_class c, pg_attribute a - where @NAMESPACE@.slon_quote_brute(n.nspname) = p_namespace and - c.relnamespace = n.oid and - @NAMESPACE@.slon_quote_brute(c.relname) = p_table and - a.attrelid = c.oid and - @NAMESPACE@.slon_quote_brute(a.attname) = p_field; - if not found then + if not @NAMESPACE@.check_table_field_exists(p_namespace, p_table, p_field) then raise notice 'Upgrade table %.% - add field %', p_namespace, p_table, p_field; v_query := 'alter table ' || p_namespace || '.' || p_table || ' add column '; v_query := v_query || p_field || ' ' || p_type || ';'; @@ -5080,9 +5088,196 @@ create table @NAMESPACE@.sl_components ( v_query := 'create table @NAMESPACE@.sl_event_lock (dummy integer);'; execute v_query; end if; + + -- + -- On the upgrade to 2.2, we change the layout of sl_log_N by + -- adding columns log_tablenspname, log_tablerelname, and + -- log_cmdupdncols as well as changing log_cmddata into + -- log_cmdargs, which is a text array. + -- + if not @NAMESPACE@.check_table_field_exists('_@CLUSTERNAME@', 'sl_log_1', 'log_cmdargs') then + -- + -- Check that the cluster is completely caught up + -- + if @NAMESPACE@.check_unconfirmed_log() then + raise EXCEPTION 'cannot upgrade to new sl_log_N format due to existing unreplicated data'; + end if; + + -- + -- Drop tables sl_log_1 and sl_log_2 + -- + drop table @NAMESPACE@.sl_log_1; + drop table @NAMESPACE@.sl_log_2; + + -- + -- Create the new sl_log_1 + -- + create table @NAMESPACE@.sl_log_1 ( + log_origin int4, + log_txid bigint, + log_tableid int4, + log_actionseq int8, + log_tablenspname text, + log_tablerelname text, + log_cmdtype char, + log_cmdupdncols int4, + log_cmdargs text[] + ) without oids; + create index sl_log_1_idx1 on @NAMESPACE@.sl_log_1 + (log_origin, log_txid, log_actionseq); + + comment on table @NAMESPACE@.sl_log_1 is 'Stores each change to be propagated to subscriber nodes'; + comment on column @NAMESPACE@.sl_log_1.log_origin is 'Origin node from which the change came'; + comment on column @NAMESPACE@.sl_log_1.log_txid is 'Transaction ID on the origin node'; + comment on column @NAMESPACE@.sl_log_1.log_tableid is 'The table ID (from sl_table.tab_id) that this log entry is to affect'; + comment on column @NAMESPACE@.sl_log_1.log_actionseq is 'The sequence number in which actions will be applied on replicas'; + comment on column @NAMESPACE@.sl_log_1.log_tablenspname is 'The schema name of the table affected'; + comment on column @NAMESPACE@.sl_log_1.log_tablerelname is 'The table name of the table affected'; + comment on column @NAMESPACE@.sl_log_1.log_cmdtype is 'Replication action to take. U = Update, I = Insert, D = DELETE, T = TRUNCATE'; + comment on column @NAMESPACE@.sl_log_1.log_cmdupdncols is 'For cmdtype=U the number of updated columns in cmdargs'; + comment on column @NAMESPACE@.sl_log_1.log_cmdargs is 'The data needed to perform the log action on the replica'; + + -- + -- Create the new sl_log_2 + -- + create table @NAMESPACE@.sl_log_2 ( + log_origin int4, + log_txid bigint, + log_tableid int4, + log_actionseq int8, + log_tablenspname text, + log_tablerelname text, + log_cmdtype char, + log_cmdupdncols int4, + log_cmdargs text[] + ) without oids; + create index sl_log_2_idx1 on @NAMESPACE@.sl_log_2 + (log_origin, log_txid, log_actionseq); + + comment on table @NAMESPACE@.sl_log_2 is 'Stores each change to be propagated to subscriber nodes'; + comment on column @NAMESPACE@.sl_log_2.log_origin is 'Origin node from which the change came'; + comment on column @NAMESPACE@.sl_log_2.log_txid is 'Transaction ID on the origin node'; + comment on column @NAMESPACE@.sl_log_2.log_tableid is 'The table ID (from sl_table.tab_id) that this log entry is to affect'; + comment on column @NAMESPACE@.sl_log_2.log_actionseq is 'The sequence number in which actions will be applied on replicas'; + comment on column @NAMESPACE@.sl_log_2.log_tablenspname is 'The schema name of the table affected'; + comment on column @NAMESPACE@.sl_log_2.log_tablerelname is 'The table name of the table affected'; + comment on column @NAMESPACE@.sl_log_2.log_cmdtype is 'Replication action to take. U = Update, I = Insert, D = DELETE, T = TRUNCATE'; + comment on column @NAMESPACE@.sl_log_2.log_cmdupdncols is 'For cmdtype=U the number of updated columns in cmdargs'; + comment on column @NAMESPACE@.sl_log_2.log_cmdargs is 'The data needed to perform the log action on the replica'; + + -- + -- Put the log apply triggers back onto sl_log_1/2 + -- + create trigger apply_trigger + before INSERT on @NAMESPACE@.sl_log_1 + for each row execute procedure @NAMESPACE@.log_apply(); + alter table @NAMESPACE@.sl_log_1 + enable replica trigger apply_trigger; + create trigger apply_trigger + before INSERT on @NAMESPACE@.sl_log_2 + for each row execute procedure @NAMESPACE@.log_apply(); + alter table @NAMESPACE@.sl_log_2 + enable replica trigger apply_trigger; + end if; + return p_old; end; -$$ language plpgsql +$$ language plpgsql; + +create or replace function @NAMESPACE@.check_unconfirmed_log () +returns bool as $$ +declare + v_rc bool = false; + v_error bool = false; + v_origin integer; + v_allconf bigint; + v_allsnap txid_snapshot; + v_count bigint; +begin + -- + -- Loop over all nodes that are the origin of at least one set + -- + for v_origin in select distinct set_origin as no_id + from @NAMESPACE@.sl_set loop + -- + -- Per origin determine which is the highest event seqno + -- that is confirmed by all subscribers to any of the + -- origins sets. + -- + select into v_allconf min(max_seqno) from ( + select con_received, max(con_seqno) as max_seqno + from @NAMESPACE@.sl_confirm + where con_origin = v_origin + and con_received in ( + select distinct sub_receiver + from @NAMESPACE@.sl_set as SET, + @NAMESPACE@.sl_subscribe as SUB + where SET.set_id = SUB.sub_set + and SET.set_origin = v_origin + ) + group by con_received + ) as maxconfirmed; + if not found then + raise NOTICE 'check_unconfirmed_log(): cannot determine highest ev_seqno for node % confirmed by all subscribers', v_origin; + v_error = true; + continue; + end if; + + -- + -- Get the txid snapshot that corresponds with that event + -- + select into v_allsnap ev_snapshot + from @NAMESPACE@.sl_event + where ev_origin = v_origin + and ev_seqno = v_allconf; + if not found then + raise NOTICE 'check_unconfirmed_log(): cannot find event %,% in sl_event', v_origin, v_allconf; + v_error = true; + continue; + end if; + + -- + -- Count the number of log rows that appeard after that event. + -- + select into v_count count(*) from ( + select 1 from @NAMESPACE@.sl_log_1 + where log_origin = v_origin + and log_txid >= "pg_catalog".txid_snapshot_xmax(v_allsnap) + union all + select 1 from @NAMESPACE@.sl_log_1 + where log_origin = v_origin + and log_txid in ( + select * from "pg_catalog".txid_snapshot_xip(v_allsnap) + ) + union all + select 1 from @NAMESPACE@.sl_log_2 + where log_origin = v_origin + and log_txid >= "pg_catalog".txid_snapshot_xmax(v_allsnap) + union all + select 1 from @NAMESPACE@.sl_log_2 + where log_origin = v_origin + and log_txid in ( + select * from "pg_catalog".txid_snapshot_xip(v_allsnap) + ) + ) as cnt; + + if v_count > 0 then + raise NOTICE 'check_unconfirmed_log(): origin % has % log rows that have not propagated to all subscribers yet', v_origin, v_count; + v_rc = true; + end if; + end loop; + + if v_error then + raise EXCEPTION 'check_unconfirmed_log(): aborting due to previous inconsistency'; + end if; + + return v_rc; +end; +$$ language plpgsql; + +-- +-- XXX What is this doing here? +-- set search_path to @NAMESPACE@ ; @@ -5520,23 +5715,37 @@ comment on function @NAMESPACE@.slon_node_health_check() is 'called when slon st create or replace function @NAMESPACE@.log_truncate () returns trigger as $$ declare - c_command text; + c_nspname text; + c_relname text; c_log integer; c_node integer; c_tabid integer; begin c_tabid := tg_argv[0]; c_node := @NAMESPACE@.getLocalNodeId('_@CLUSTERNAME@'); - c_command := 'TRUNCATE TABLE ONLY "' || tab_nspname || '"."' || - tab_relname || '" CASCADE;' + select tab_nspname, tab_relname into c_nspname, c_relname from @NAMESPACE@.sl_table where tab_id = c_tabid; select last_value into c_log from @NAMESPACE@.sl_log_status; if c_log in (0, 2) then - insert into @NAMESPACE@.sl_log_1 (log_origin, log_txid, log_tableid, log_actionseq, log_cmdtype, log_cmddata) - values (c_node, pg_catalog.txid_current(), c_tabid, nextval('_@CLUSTERNAME@.sl_action_seq'), 'T', c_command); + insert into @NAMESPACE@.sl_log_1 ( + log_origin, log_txid, log_tableid, + log_actionseq, log_tablenspname, + log_tablerelname, log_cmdtype, + log_cmdupdncols, log_cmdargs + ) values ( + c_node, pg_catalog.txid_current(), c_tabid, + nextval('@NAMESPACE@.sl_action_seq'), c_nspname, + c_relname, 'T', 0, array[]::text[]); else -- (1, 3) - insert into @NAMESPACE@.sl_log_2 (log_origin, log_txid, log_tableid, log_actionseq, log_cmdtype, log_cmddata) - values (c_node, pg_catalog.txid_current, c_tabid, nextval('_@CLUSTERNAME@.sl_action_seq'), 'T', c_command); + insert into @NAMESPACE@.sl_log_2 ( + log_origin, log_txid, log_tableid, + log_actionseq, log_tablenspname, + log_tablerelname, log_cmdtype, + log_cmdupdncols, log_cmdargs + ) values ( + c_node, pg_catalog.txid_current(), c_tabid, + nextval('@NAMESPACE@.sl_action_seq'), c_nspname, + c_relname, 'T', 0, array[]::text[]); end if; return NULL; end @@ -5680,3 +5889,111 @@ tables that are already exclusivly locked by the current transaction are repaired. Otherwise all replicated tables with outdated trigger arguments are recreated.'; + +create or replace function @NAMESPACE@.log_apply() returns trigger +as $$ +declare + v_command text = 'not implemented yet'; + v_list1 text = ''; + v_list2 text = ''; + v_comma text = ''; + v_and text = ''; + v_idx integer = 1; + v_nargs integer; + v_i integer = 0; +begin + v_nargs = array_upper(NEW.log_cmdargs, 1); + + if NEW.log_cmdtype = 'I' then + while v_idx < v_nargs loop + v_list1 = v_list1 || v_comma || + @NAMESPACE@.slon_quote_brute(NEW.log_cmdargs[v_idx]); + v_idx = v_idx + 1; + v_list2 = v_list2 || v_comma || + pg_catalog.quote_literal(NEW.log_cmdargs[v_idx]); + v_idx = v_idx + 1; + + v_comma = ','; + end loop; + + v_command = 'INSERT INTO ' || + @NAMESPACE@.slon_quote_brute(NEW.log_tablenspname) || '.' || + @NAMESPACE@.slon_quote_brute(NEW.log_tablerelname) || ' (' || + v_list1 || ') VALUES (' || v_list2 || ')'; + + execute v_command; + end if; + + if NEW.log_cmdtype = 'U' then + v_command = 'UPDATE ONLY ' || + @NAMESPACE@.slon_quote_brute(NEW.log_tablenspname) || '.' || + @NAMESPACE@.slon_quote_brute(NEW.log_tablerelname) || ' SET '; + while v_i < NEW.log_cmdupdncols loop + v_command = v_command || v_comma || + @NAMESPACE@.slon_quote_brute(NEW.log_cmdargs[v_idx]) || '='; + v_idx = v_idx + 1; + v_command = v_command || + pg_catalog.quote_literal(NEW.log_cmdargs[v_idx]); + v_idx = v_idx + 1; + v_comma = ','; + v_i = v_i + 1; + end loop; + if NEW.log_cmdupdncols = 0 then + v_command = v_command || + @NAMESPACE@.slon_quote_brute(NEW.log_cmdargs[1]) || '=' || + @NAMESPACE@.slon_quote_brute(NEW.log_cmdargs[1]); + end if; + v_command = v_command || ' WHERE '; + while v_idx < v_nargs loop + v_command = v_command || v_and || + @NAMESPACE@.slon_quote_brute(NEW.log_cmdargs[v_idx]) || '='; + v_idx = v_idx + 1; + v_command = v_command || + pg_catalog.quote_literal(NEW.log_cmdargs[v_idx]); + v_idx = v_idx + 1; + + v_and = ' AND '; + end loop; + + execute v_command; + end if; + + if NEW.log_cmdtype = 'D' then + v_command = 'DELETE FROM ONLY ' || + @NAMESPACE@.slon_quote_brute(NEW.log_tablenspname) || '.' || + @NAMESPACE@.slon_quote_brute(NEW.log_tablerelname) || ' WHERE '; + while v_idx < v_nargs loop + v_command = v_command || v_and || + @NAMESPACE@.slon_quote_brute(NEW.log_cmdargs[v_idx]) || '='; + v_idx = v_idx + 1; + v_command = v_command || + pg_catalog.quote_literal(NEW.log_cmdargs[v_idx]); + v_idx = v_idx + 1; + + v_and = ' AND '; + end loop; + + execute v_command; + end if; + + if NEW.log_cmdtype = 'T' then + perform @NAMESPACE@.TruncateOnlyTable( + @NAMESPACE@.slon_quote_brute(NEW.log_tablenspname) || '.' || + @NAMESPACE@.slon_quote_brute(NEW.log_tablerelname)); + end if; + + return NEW; +end; +$$ language plpgsql; + +create trigger apply_trigger + before INSERT on @NAMESPACE@.sl_log_1 + for each row execute procedure @NAMESPACE@.log_apply(); +alter table @NAMESPACE@.sl_log_1 + enable replica trigger apply_trigger; +create trigger apply_trigger + before INSERT on @NAMESPACE@.sl_log_2 + for each row execute procedure @NAMESPACE@.log_apply(); +alter table @NAMESPACE@.sl_log_2 + enable replica trigger apply_trigger; + diff --git a/src/slon/confoptions.c b/src/slon/confoptions.c index 255d7ea2..81f55684 100644 --- a/src/slon/confoptions.c +++ b/src/slon/confoptions.c @@ -133,30 +133,6 @@ static struct config_int ConfigureNamesInt[] = 0, 2147483647 }, - { - { - (const char *) "sync_max_rowsize", /* conf name */ - gettext_noop("sl_log_? rows larger than that are read separately"), /* short desc */ - gettext_noop("sl_log_? rows with octet_length(log_cmddata) larger than this are read separately"), /* long desc */ - SLON_C_INT /* config type */ - }, - &sync_max_rowsize, /* var name */ - 8192, /* default val */ - 1024, /* min val */ - 32768 /* max val */ - }, - { - { - (const char *) "sync_max_largemem", /* conf name */ - gettext_noop("How much memory to allow for sl_log_? rows exceeding sync_max_rowsize"), /* short desc */ - gettext_noop("How much memory to allow for sl_log_? rows exceeding sync_max_rowsize"), /* long desc */ - SLON_C_INT /* config type */ - }, - &sync_max_largemem, /* var name */ - 5242880, /* default val */ - 1048576, /* min val */ - 1073741824 /* max val */ - }, { { diff --git a/src/slon/confoptions.h b/src/slon/confoptions.h index 8f62a678..6fd315e9 100644 --- a/src/slon/confoptions.h +++ b/src/slon/confoptions.h @@ -18,8 +18,6 @@ extern char *archive_dir; extern int slon_log_level; extern int sync_interval; extern int sync_interval_timeout; -extern int sync_max_rowsize; -extern int sync_max_largemem; extern int remote_listen_timeout; extern int sync_group_maxsize; diff --git a/src/slon/remote_worker.c b/src/slon/remote_worker.c index 1671f3de..f2d7d5b7 100644 --- a/src/slon/remote_worker.c +++ b/src/slon/remote_worker.c @@ -243,8 +243,6 @@ static struct node_confirm_status *node_confirm_tail = NULL; static pthread_mutex_t node_confirm_lock = PTHREAD_MUTEX_INITIALIZER; int sync_group_maxsize; -int sync_max_rowsize; -int sync_max_largemem; int explain_interval; time_t explain_lastsec; int explain_thistime; @@ -275,7 +273,6 @@ static void start_monitored_event(PerfMon *pm); static void monitor_provider_query(PerfMon *pm); static void monitor_subscriber_query(PerfMon *pm); static void monitor_subscriber_iud(PerfMon *pm); -static void monitor_largetuples(PerfMon *pm); static void adjust_provider_info(SlonNode *node, WorkerGroupData *wd, int cleanup); @@ -4067,7 +4064,7 @@ sync_event(SlonNode *node, SlonConn *local_conn, ntables_total += ntuples2; /* - * ... and build up a the provider query + * ... and build up the provider query */ for (sl_log_no = 1; sl_log_no <= 2; sl_log_no++) { @@ -4101,15 +4098,12 @@ sync_event(SlonNode *node, SlonConn *local_conn, */ slon_appendquery(provider_query, "select log_origin, log_txid, log_tableid, " - "log_actionseq, log_cmdtype, " - "octet_length(log_cmddata), " - "case when octet_length(log_cmddata) <= %d " - "then log_cmddata " - "else null end " + "log_actionseq, log_tablenspname, " + "log_tablerelname, log_cmdtype, " + "log_cmdupdncols, log_cmdargs " "from %s.sl_log_%d " "where log_origin = %d " "and log_tableid in (", - sync_max_rowsize, rtcfg_namespace, sl_log_no, node->no_id); for (tupno2 = 0; tupno2 < ntuples2; tupno2++) @@ -4169,15 +4163,12 @@ sync_event(SlonNode *node, SlonConn *local_conn, slon_appendquery(provider_query, "union all " "select log_origin, log_txid, log_tableid, " - "log_actionseq, log_cmdtype, " - "octet_length(log_cmddata), " - "case when octet_length(log_cmddata) <= %d " - "then log_cmddata " - "else null end " + "log_actionseq, log_tablenspname, " + "log_tablerelname, log_cmdtype, " + "log_cmdupdncols, log_cmdargs " "from %s.sl_log_%d " "where log_origin = %d " "and log_tableid in (", - sync_max_rowsize, rtcfg_namespace, sl_log_no, node->no_id); for (tupno2 = 0; tupno2 < ntuples2; tupno2++) @@ -4279,14 +4270,12 @@ sync_event(SlonNode *node, SlonConn *local_conn, slon_mkquery(provider_query, "declare LOG cursor for " "select log_origin, log_txid, log_tableid, " - "log_actionseq, log_cmdtype, " - "octet_length(log_cmddata), " - "case when octet_length(log_cmddata) <= %d " - "then log_cmddata " - "else null end " + "log_actionseq, log_tablenspname, " + "log_tablerelname, log_cmdtype, " + "log_cmdupdncols, log_cmdargs " "from %s.sl_log_1 " "where false", - sync_max_rowsize, rtcfg_namespace); + rtcfg_namespace); } } @@ -4794,7 +4783,6 @@ sync_helper(void *cdata) PGresult *res = NULL; PGresult *res2 = NULL; - PGresult *res3 = NULL; int ntuples; int tupno; @@ -4870,33 +4858,33 @@ sync_helper(void *cdata) rtcfg_namespace); start_monitored_event(&pm); - res3 = PQexec(dbconn, dstring_data(&query)); + res2 = PQexec(dbconn, dstring_data(&query)); monitor_provider_query(&pm); - rc = PQresultStatus(res3); + rc = PQresultStatus(res2); if (rc != PGRES_TUPLES_OK) { slon_log(SLON_ERROR, "remoteWorkerThread_%d: \"%s\" %s %s\n", node->no_id, dstring_data(&query), PQresStatus(rc), - PQresultErrorMessage(res3)); - PQclear(res3); + PQresultErrorMessage(res2)); + PQclear(res2); errors++; break; } - if (PQntuples(res3) != 1) + if (PQntuples(res2) != 1) { slon_log(SLON_ERROR, "remoteWorkerThread_%d: \"%s\" %s returned %d tuples\n", node->no_id, dstring_data(&query), - PQresStatus(rc), PQntuples(res3)); - PQclear(res3); + PQresStatus(rc), PQntuples(res2)); + PQclear(res2); errors++; break; } - log_status = strtol(PQgetvalue(res3, 0, 0), NULL, 10); - PQclear(res3); + log_status = strtol(PQgetvalue(res2, 0, 0), NULL, 10); + PQclear(res2); slon_log(SLON_DEBUG2, "remoteWorkerThread_%d_%d: current remote log_status = %d\n", node->no_id, provider->no_id, log_status); @@ -5018,34 +5006,8 @@ sync_helper(void *cdata) * available line buffers. */ pthread_mutex_lock(&(wd->workdata_lock)); - if (data_line_alloc == 0 || - wd->workdata_largemem > sync_max_largemem) + if (data_line_alloc == 0) { - /* - * First make sure that the overall memory usage is inside - * bounds. - */ - if (wd->workdata_largemem > sync_max_largemem) - { - slon_log(SLON_DEBUG4, - "remoteHelperThread_%d_%d: wait for oversize memory to free\n", - node->no_id, provider->no_id); - - while (wd->workdata_largemem > sync_max_largemem && - wd->workgroup_status == SLON_WG_BUSY) - { - pthread_cond_wait(&(wd->linepool_cond), &(wd->workdata_lock)); - } - if (wd->workgroup_status != SLON_WG_BUSY) - { - slon_log(SLON_DEBUG4, - "remoteHelperThread_%d_%d: abort operation\n", - node->no_id, provider->no_id); - errors++; - break; - } - } - /* * Second make sure that we have at least 1 line buffer. */ @@ -5157,60 +5119,14 @@ sync_helper(void *cdata) int log_tableid = strtol(PQgetvalue(res, tupno, 2), NULL, 10); char *log_actionseq = PQgetvalue(res, tupno, 3); - char *log_cmdtype = PQgetvalue(res, tupno, 4); - int log_cmdsize = strtol(PQgetvalue(res, tupno, 5), - NULL, 10); - char *log_cmddata = PQgetvalue(res, tupno, 6); - int largemem = 0; + char *log_tablenspname = PQgetvalue(res, tupno, 4); + char *log_tablerelname = PQgetvalue(res, tupno, 5); + char *log_cmdtype = PQgetvalue(res, tupno, 6); + char *log_cmdupdncols = PQgetvalue(res, tupno, 7); + char *log_cmdargs = PQgetvalue(res, tupno, 8); tupno++; - if (log_cmdsize >= sync_max_rowsize) - { - (void) slon_mkquery(&query2, - "select log_cmddata " - "from %s.sl_log_1 " - "where log_origin = '%s' " - " and log_txid = '%s' " - " and log_actionseq = '%s' " - "UNION ALL " - "select log_cmddata " - "from %s.sl_log_2 " - "where log_origin = '%s' " - " and log_txid = '%s' " - " and log_actionseq = '%s'", - rtcfg_namespace, - log_origin, log_txid, log_actionseq, - rtcfg_namespace, - log_origin, log_txid, log_actionseq); - start_monitored_event(&pm); - res2 = PQexec(dbconn, dstring_data(&query2)); - monitor_largetuples(&pm); - - if (PQresultStatus(res2) != PGRES_TUPLES_OK) - { - slon_log(SLON_ERROR, "remoteHelperThread_%d_%d: \"%s\" %s", - node->no_id, provider->no_id, - dstring_data(&query), - PQresultErrorMessage(res2)); - PQclear(res2); - errors++; - break; - } - if (PQntuples(res2) != 1) - { - slon_log(SLON_ERROR, "remoteHelperThread_%d_%d: large log_cmddata for actionseq %s not found\n", - node->no_id, provider->no_id, - log_actionseq); - PQclear(res2); - errors++; - break; - } - - log_cmddata = PQgetvalue(res2, 0, 0); - largemem = log_cmdsize; - } - /* * This can happen if the table belongs to a set that * already has a better sync status than the event we're @@ -5220,8 +5136,6 @@ sync_helper(void *cdata) if (log_tableid >= wd->tab_fqname_size || wd->tab_fqname[log_tableid] == NULL) { - if (largemem > 0) - PQclear(res2); continue; } @@ -5234,59 +5148,24 @@ sync_helper(void *cdata) slon_appendquery(&(line->log), "insert into %s.sl_log_%d " " (log_origin, log_txid, log_tableid, " - " log_actionseq, log_cmdtype, " - " log_cmddata) values " - " ('%s', '%s', '%d', '%s', '%q', '%q');\n", + " log_actionseq, log_tablenspname, " + " log_tablerelname, log_cmdtype, " + " log_cmdupdncols, " + " log_cmdargs) values " + " ('%s', '%s', '%d', '%s', '%q', '%q', '%q', '%q', '%q');\n", rtcfg_namespace, wd->active_log_table, log_origin, log_txid, log_tableid, - log_actionseq, log_cmdtype, log_cmddata); - largemem *= 2; + log_actionseq, log_tablenspname, + log_tablerelname, log_cmdtype, + log_cmdupdncols, log_cmdargs); } - /* - * Add the actual replicating command to the line buffer - */ - line->line_largemem += largemem; - switch (*log_cmdtype) - { - case 'I': - slon_appendquery(&(line->data), - "insert into %s %s;\n", - wd->tab_fqname[log_tableid], - log_cmddata); - pm.num_inserts++; - break; - - case 'U': - slon_appendquery(&(line->data), - "update only %s set %s;\n", - wd->tab_fqname[log_tableid], - log_cmddata); - pm.num_updates++; - break; - - case 'D': - slon_appendquery(&(line->data), - "delete from only %s where %s;\n", - wd->tab_fqname[log_tableid], - log_cmddata); - pm.num_deletes++; - break; - case 'T': - slon_appendquery(&(line->data), - "%s;\n", - log_cmddata); - pm.num_truncates++; - break; - } line_ncmds++; if (line_ncmds >= SLON_COMMANDS_PER_LINE) { if (data_line_last >= data_line_alloc) { - if (largemem > 0) - PQclear(res2); break; } @@ -5300,29 +5179,6 @@ sync_helper(void *cdata) line_ncmds = 0; } - - /* - * If this was a large log_cmddata entry (> - * sync_max_rowsize), add this to the memory usage of the - * workgroup and check if we are exceeding limits. - */ - if (largemem > 0) - { - PQclear(res2); - pthread_mutex_lock(&(wd->workdata_lock)); - wd->workdata_largemem += largemem; - if (wd->workdata_largemem >= sync_max_largemem) - { - /* - * This is it ... we exit the loop here and wait - * for the worker to apply enough of the large - * rows first. - */ - pthread_mutex_unlock(&(wd->workdata_lock)); - break; - } - pthread_mutex_unlock(&(wd->workdata_lock)); - } } /* @@ -6151,10 +6007,3 @@ static void monitor_subscriber_iud(PerfMon *perf_info) { (perf_info->subscr_iud__c) ++; } -static void monitor_largetuples(PerfMon *perf_info) { - double diff; - gettimeofday(&(perf_info->now_t), NULL); - diff = TIMEVAL_DIFF(&(perf_info->prev_t), &(perf_info->now_t)); - (perf_info->large_tuples_t) += diff; - (perf_info->large_tuples_c) ++; -} diff --git a/src/slon/slon.h b/src/slon/slon.h index 173d9fe7..e4342017 100644 --- a/src/slon/slon.h +++ b/src/slon/slon.h @@ -557,8 +557,6 @@ extern void *remoteListenThread_main(void *cdata); * ---------- */ extern int sync_group_maxsize; -extern int sync_max_rowsize; -extern int sync_max_largemem; extern int explain_interval; diff --git a/tests/run_test.sh b/tests/run_test.sh index 12c2f07a..d8eb8bba 100755 --- a/tests/run_test.sh +++ b/tests/run_test.sh @@ -493,8 +493,6 @@ build_slonconf() echo "sync_interval=2010" >> ${CONFFILE} echo "sync_interval_timeout=15000" >> ${CONFFILE} echo "sync_group_maxsize=8" >> ${CONFFILE} - echo "sync_max_rowsize=4096" >> ${CONFFILE} - echo "sync_max_largemem=1048576" >> ${CONFFILE} echo "syslog=1" >> ${CONFFILE} echo "log_timestamp=true" >> ${CONFFILE} echo "log_timestamp_format='%Y-%m-%d %H:%M:%S %Z'" >> ${CONFFILE} diff --git a/tools/check_unconfirmed_log.sh b/tools/check_unconfirmed_log.sh new file mode 100644 index 00000000..7cf6f767 --- /dev/null +++ b/tools/check_unconfirmed_log.sh @@ -0,0 +1,94 @@ +#!/bin/sh + +if [ $# -lt 2 ] ; then + echo "usage: `basename $0` clustername [psql-options] dbname" >&2 + exit 1 +fi + +cluster=$1; shift +nsp="\"_${cluster}\"" +psql="psql -qtA $*" +rc=0 + +# +# Get a list of all nodes that are origin to at least one set +# +origins=`${psql} <<_EOF_ + select distinct set_origin from ${nsp}.sl_set; +_EOF_ +` + +for origin in $origins ; do + # + # Per origin determine which is the highest event seqno + # that is confirmed by all subscribers to any of the origins + # sets. + # + all_confirmed=`${psql} <<_EOF_ + select min(max_seqno) from ( + select con_received, max(con_seqno) as max_seqno + from ${nsp}.sl_confirm + where con_origin = '${origin}' + and con_received in ( + select distinct sub_receiver from ${nsp}.sl_subscribe SUB, + ${nsp}.sl_set SET + where SET.set_id = SUB.sub_set + and SET.set_origin = '${origin}' + ) + group by con_received + ) as maxconfirmed; +_EOF_ +` + + # + # Get the txid snapshot that corresponds with that event + # + all_snapshot=`${psql} <<_EOF_ + select ev_snapshot from ${nsp}.sl_event + where ev_origin = '${origin}' + and ev_seqno = '${all_confirmed}'; +_EOF_ +` + + # + # Count the number of unconfirmed sl_log rows that appeared after + # that event was created. + # + unconfirmed=`${psql} <<_EOF_ + select count(*) from ( + select log_origin from ${nsp}.sl_log_1 + where log_origin = '${origin}' + and log_txid >= "pg_catalog".txid_snapshot_xmax('${all_snapshot}') + union all + select log_origin from ${nsp}.sl_log_1 + where log_origin = '${origin}' + and log_txid in ( + select * from "pg_catalog".txid_snapshot_xip('${all_snapshot}') + ) + union all + select log_origin from ${nsp}.sl_log_2 + where log_origin = '${origin}' + and log_txid >= "pg_catalog".txid_snapshot_xmax('${all_snapshot}') + union all + select log_origin from ${nsp}.sl_log_2 + where log_origin = '${origin}' + and log_txid in ( + select * from "pg_catalog".txid_snapshot_xip('${all_snapshot}') + ) + ) AS cnt; +_EOF_ +` + # + # Report the result + # + if [ $unconfirmed -gt 0 ] ; then + echo "origin $origin: ERROR - node has $unconfirmed unconfirmed log rows" + echo "origin $origin: the last event confirmed by all subscribers" + echo "origin $origin: is $all_confirmed" + rc=2 + else + echo "origin $origin: OK" + fi +done + +exit ${rc} diff --git a/tools/mkservice/slon-mkservice.sh b/tools/mkservice/slon-mkservice.sh index ac27e6a7..1e203230 100644 --- a/tools/mkservice/slon-mkservice.sh +++ b/tools/mkservice/slon-mkservice.sh @@ -304,20 +304,6 @@ log_timestamp 0 # multilog will insert a tai64n timestamp # If the value is left empty, this logic will be ignored. #lag_interval -# Size above which an sl_log_? row's log_cmddata is considered large. Up to -# 500 rows of this size are allowed in memory at once. Rows larger than that -# count into the sync_max_largemem space allocated and free()'ed on demand. -# The default value is 8192, meaning that your expected memory consumption -# (for the LOG cursor) should not exceed 8MB. -#sync_max_rowsize 8192 - -# Maximum memory allocated for large rows, where log_cmddata are larger than -# sync_max_rowsize. Note that the algorithm reads rows until after this value -# is exceeded. Otherwise, a tuple larger than this value would stall -# replication. As a result, don't assume that memory consumption will remain -# smaller than this value. The default value is 5242880. -#sync_max_largemem 5242880 - # How long should the remote listener wait before treating the event selection # criteria as having timed out? # Range: [30-30000], default 300 diff --git a/tools/mkslonconf.sh b/tools/mkslonconf.sh index 5995dcef..c9f5359c 100755 --- a/tools/mkslonconf.sh +++ b/tools/mkslonconf.sh @@ -65,20 +65,6 @@ cat <<_EOF_ > $conffile # Range: [0,100], default: 6 #sync_group_maxsize=6 -# Size above which an sl_log_? row's log_cmddata is considered large. -# Up to 500 rows of this size are allowed in memory at once. Rows larger -# than that count into the sync_max_largemem space allocated and free'd -# on demand. -# Range: [1024,32768], default: 8192 -#sync_max_rowsize=8192 - -# Maximum amount of memory allowed for large rows. Note that the algorithm -# will stop fetching rows AFTER this amount is exceeded, not BEFORE. This -# is done to ensure that a single row exceeding this limit alone does not -# stall replication. -# Range: [1048576,1073741824], default: 5242880 -#sync_max_largemem=5242880 - # If this parameter is 1, messages go both to syslog and the standard # output. A value of 2 sends output only to syslog (some messages will # still go to the standard output/error). The default is 0, which means From 334084228efd7bf689d51a48225b92ff7078c7d9 Mon Sep 17 00:00:00 2001 From: Christopher Browne Date: Wed, 26 Oct 2011 12:21:30 -0400 Subject: [PATCH 2/7] Empty out release notes, start on 2.2 oriented ones --- RELEASE | 261 +++++++++++++------------------------------------------- 1 file changed, 60 insertions(+), 201 deletions(-) diff --git a/RELEASE b/RELEASE index 1b27599e..409e65bb 100644 --- a/RELEASE +++ b/RELEASE @@ -1,203 +1,62 @@ #+OPTIONS: ^:{} * Slony-I Release Notes - -** 2.1.0 RC 2 - -- Bug #236 :: Fix default formatting of timestamp in logs - -- Add support for PostgreSQL 9.1. Simply marking it a supported version - -- Bug #237 :: Drop set did not remove truncate triggers. - -** 2.1.0 RC 1 - -- Bug #226 :: Cleanup thread needed change to expected PQResultStatus - -- Bug #229 :: Fix to set add table so it won't implicitly wait for an event - inside of a transaction block. - -- Bug #230 :: log_timestamps was always treated as false - -- Bug #231 :: Fix to regex in tools/start_slon.sh - -- Bug #227 :: Do not try to add views to a set with regular expressions in - set add table. Also fixes for escape characters in the regex - -- Clearer error message on 'create set' when no origin is specified. - -- Clearer error message on 'lock set' when no origin is specified. - -- Bug #218 :: Additional fixes, obtain sl_event_lock before sl_config_lock - to prevent deadlock. -- Include additional C headers required for Postgresql 9.2(master) - -** 2.1.0 (beta 3) - -- Bug #159 :: distclean deletes the slony_logshipper flex/bison generated files. - -- Bug #204 :: Additional fixes for failover to a non-direct subscriber - where circular paths in sl_subscribe could happen - -- Bug #214 :: Add slonikconfdump.sh back into tools - -- Bug #216 :: Use EPOCH for the timestamp in the monitor thread - to avoid differences in how Win32 handles timezones. - -- Bug #218 :: Acquire lock on sl_config_lock in much the same fashion as - with sl_event_lock (bug #196) - -- Bug #219 :: Default to PostgreSQL 8.4 support if the version of PG is newer - than what slony recognizes. - -- Bug #220 :: Fix issue where changing the provider of an existing - subscriber passed parameters in the wrong order to the - stored procedure. - -- Bug #222 :: Fixing issue where new connections that call the - logtrigger for the first time might block until an - in progress cleanupEvent finishes. - -- Bug #223 :: Clear out the last saved event number when uninstalling - a node. This prevents slonik from waiting for a node it just - uninstalled. - -- Bug #224 :: altperl code misspelled "PKEYDTABLES" - -*** Some items without bug numbers: - -- Fixed slonik memory corruption when it tries to get the last known - event_id from a node that doesn't yet have slony installed. - -- Remove rules for building PDFs for the original design docs, in - favor of having the built docs stored in a new "historical - documentation" directory. - -** 2.1.0 (beta 2) -- Bug 219 :: Default to PostgreSQL 8.4 support if the version of PG is newer than - what slony recognizes. - -- Fix threading issue in monitor_thread where slon_init can be called - without the mutex being locked. This function was written to assume - the mutex lock exists. - -- datarootdir warning from autoconf fixed - -- Bug #36 - (Reapplied) don't link with pgport on non-Win32 platforms - -- Misc compiler warnings including no longer calling get_share_dir from - Postgres if PGSHARE is not defined. Configure should define it. - -- Regenerated complexenv.png diagram - -- Obtain a lock on sl_event_lock during MOVE_SET - processing in remote_worker. - -** 2.1.0 (beta 2) - -- Bug #204 :: Upgrade from 2.0.x fails under PostgreSQL 8.3, fixing - issues with failover and non-direct subscribers - -- Bug #205 :: Upgrade fails from 2.0.0, return type from cloneNode changes - -- Bug #206 :: Do not perform an accidental rollback in a try block - -- Bug #208 :: Fixing issues with bulk adding of tables. - -- Bug #209 :: Default table ID problem - -- Bug #210 :: merge set should wait for both sets to be subscribed - before submitting the merge event. - -- Bug #211 :: Modify the altperl tools so they don't enclose statements - that wait for events inside of a 'try' block. - -** 2.1.0 (beta 1) - -*** Some items without bug numbers: - - Introduced tests using the clustertest framework, consisting of two - sets of tests: - - clustertest/regression - port of the old tests in the tests directory - - clustertest/disorder - new simulated order entry system with a fair bit of concurrency - - - Configure and Makefile cleanups and improvements, including - - Configure looks in common locations for some of the DocBook - tooling, so it is less likely to require manual intervention on - some common distributions - - Pick up Groff automagically - - Script to do virtually all the work documented in the [[http://slony.info/documentation/2.0/releasechecklist.html][Release Checklist]] - - Documentation updates - - Reorganized sections - - Trend towards having version-specific documentation, rather than - trying to have it document all versions at once - - Git changes - - Numerous .gitignore files set up to ignore generated files - - Add a resetSession function that will reset the session state - cached in the C stored functions. - -*** Changes from 2.0 branch that were also applied to HEAD: - - Bugs 40, 42, 75, 78, 102, 104, 115, 117, 121, 122, 124, 127, 132, - 136, 138, 139, 141, 144, 147, 148, 149, 154, 162 - -*** Items tracked from Bugzilla -- Bug #79 :: --prefix and --exec-prefix options don't function as expected - -- Bug #90 :: Builds On Solaris with Sun C Studio fail. This also addresses - issues building with Microsoft Visual Studio. - -- Bug #126 :: TCP KEEP alives can now be used from slon to postgresql(on by default) - -- Bug #134 :: TRUNCATE trigger usage - -- Bug #142 :: better document minimal security profile - -- Bug #146 :: Removed option to use DELETE to trim sl_log_* tables - only support TRUNCATE - -- Bug #152 :: eliminate debugging statements from DDL processing - -- Bug #156 :: add health check at slon startup time - -- Bug #163 :: change Slony-I tables to use TIMESTAMP WITH TIME ZONE rather than WITHOUT TIME ZONE - -- Bug #167 :: change queries against sl_log_* tables to avert slowdown when large backlog - -- Bug #170 :: remove SNMP support - -- Bug #172 :: add support for application_name GUC (in recent PG such as 9.0) - -- Bug #175 :: add monitoring thread which stows activity information in sl_components - -- Bug #179 :: Implicit/Automatic wait for. Slonik will now often perform an automatic - 'wait for event' when required to avoid race conditions. - -- Bug #180 :: Created a slonik DATE command - -- Bug #181 :: Support for bulk adding of tables and sequences and automatically finding - the next available table or sequence id. - -- Bug #185 :: change functions to use named parameters - -- Bug #187 :: add newline to slon PID files - -- Bug #188 :: test harness query had subquery returning multiple tuples - -- Bug #189 :: add slonik EXIT check for exit values 0..255, as that's all that Unix accepts - -- Bug #193 :: add back reset of vac_count so vacuums only done every few cleanup thread iterations - -- Bug #195 :: change slon_quote_* functions to IMMUTABLE - -- Bug #196 :: add guard lock on sl_event_lock to protect against events with XID going backwards - -- Bug #198 :: subscribeset() should verify that provider node exists - -- Bug #201 :: Allow command-line options to be configured from slon_tools.conf - -- Bug #204 :: Fix issue with FAILOVER to a non-direct subscriber introduced in 2.0.5 - -- Bug #206 :: Do not perform an accidental rollback in a try block - -** RELEASE 2.0.6 -- Bug #162 :: typenameTypeId() changes signatures in 9.1 - - +** 2.2.0 (beta 1) +*** Significant New Features + - Switch to use COPY protocol for handling sl_log_* data + +*** Upgrade Procedures +**** Draining log tables + + Since the schema of tables ~sl_log_1~ and ~sl_log_2~ are changing + substantially, capturing somewhat different information, there is + no way provided to convert old log data to use the new schema. + As a consequence, at the time of upgrade, it is essential that + these tables be empty. + + They need to /already/ be empty, as the ~upgradeSchema()~ + function runs locally on each node, and there is no readily + available mechanism to recover from the problem of discovering + that one node still has data that needs to be applied against + another node. We may make some /best efforts/ to prevent + problems, but there is only limited cross-node coordination that + may readily be done. + + We intend to offer several mechanisms to help this to happen, + including: + + - Preventing new log entries via ~LOCK SET~ :: It is recommended + that administrators /prevent/ data from being added to the + logs accidentally by locking all replication sets using [[http://slony.info/documentation/2.1/stmtlockset.html][LOCK + SET]], then unlock them via ~UNLOCK SET~ afterwards. For + systems with enormous numbers of replicated tables (/e.g./ - + on the order of thousands), this requires taking out + exclusive locks on all of them, as ~LOCK SET~ and ~UNLOCK + SET~ both need to submit an ~ALTER TABLE~ request against + each table in order to add/drop the "lock" trigger, and may + prove too expensive. + + - Preventing new log entries via ~pg_hba.conf~ :: If ~LOCK SET~ + is too expensive, an administrator may prefer to lock out + all application users during the upgrade process. + ~pg_hba.conf~ is useful for this. The process would + involve: + - Altering ~pg_hba.conf~ to contain entries denying access to + all other than the ~slony~ user + - Submitting ~SIGHUP~ signal to the Postgres backend so new + connections are rejected + - Verifying, via query to ~pg_stat_activity~, that there are no + users other than the ~slony~ user connected + + - Script to drain log tables ~sl_log_1~ and ~sl_log_2~ :: It runs + the following logic against each node: + - Calls the function ~cleanupEvent()~ to clean out any log + entries that are safe to delete + - Verify that log tables ~sl_log_1~ and ~sl_log_2~ are empty + + Once this script has run against all nodes, reporting that + the log tables are empty on each node, it is safe to upgrade + the schema for these tables. If some nodes are not ready, + it will be necessary to keep ~slon~ processes running to + apply the outstanding log entries, and so that confirmations + are passed back to all nodes in order that the cleanup can + be finalized. From 70c1f04584f69fb5da075564b3a81fc50ae69045 Mon Sep 17 00:00:00 2001 From: Christopher Browne Date: Wed, 26 Oct 2011 12:28:06 -0400 Subject: [PATCH 3/7] Update upgrading notes --- UPGRADING | 58 ++++++++----------------------------------------------- 1 file changed, 8 insertions(+), 50 deletions(-) diff --git a/UPGRADING b/UPGRADING index 308c3a20..b6b1c5dd 100644 --- a/UPGRADING +++ b/UPGRADING @@ -1,6 +1,10 @@ -Upgrading from an earlier version of Slony-I to 1.2 ------------------------------------------------------ +Upgrading Slony +--------------- +Here are notes about updating Slony to a newer version. + +Upgrading from an earlier version of Slony-I to current: general +------------------------------------------------------------------ When upgrading Slony-I, the Slony installation on all nodes in a cluster must be upgraded at once, using the slonik command UPDATE FUNCTIONS. @@ -25,52 +29,6 @@ The proper upgrade procedure is thus: 4. Start all slons. -Upgrading is also discussed in more detail in the "Admin Guide." -The section is entitled "Slony-I Upgrade", distributed as +Upgrading is also discussed in more detail in the "Admin Guide." The +section is entitled "Slony-I Upgrade", distributed as doc/adminguide/slonyupgrade.html in the documentation package. - -Nullable Column issue in version 1.2 -===================================== - -In version 1.2, a check has been added to reject subscriptions to -tables where the candidate primary key has columns that are "Nullable" -(e.g. - that are not defined in the schema as NOT NULL). - -This was not checked in earlier versions, and people may have set up -constraints (e.g. - via triggers) to enforce NOT NULL as opposed to -using the NOT NULL column constraint. As a result, a replica running -on version 1.1 may have violations of this check. - -You may search for these violations via the following query: - -select c.relname as table_name, ic.relname as index_name, att.attname, att2.attnotnull -from _cluster.sl_table t, pg_catalog.pg_class c, pg_index i, pg_catalog.pg_class ic, pg_catalog.pg_attribute att, pg_catalog.pg_attribute att2 -where t.tab_reloid = c.oid - and t.tab_idxname = ic.relname - and ic.oid = i.indexrelid - and att.attrelid = i.indexrelid - and att2.attname = att.attname - and att2.attrelid = c.oid - and att2.attnotnull = 'f'; - -The problem may be rectified by submitting, for each entry found, a -query of the form: - alter table mytable alter column nullablecol set not null; - -It would minimally suffice to apply this to the schema of new -subscribers; such queries will run rapidly against empty tables. - -It will take longer to apply this change to a table that already -contains a great deal of data, as the alteration will scan the table -to verify that there are no tuples where the column is NULL. - -TABLE ADD KEY change in version 2.0 -===================================== - -In version 2.0, Slony-I drops out support for creating -system-generated "pseudo primary keys" that involve adding in a custom -Slony-I-generated column. - -There is documentation in the Admin Guide (slonyupgrade.sgml, -slonyupgrade.html) explaining approaches to "cleaning up" after having -used TABLE ADD KEY. From a64e7e7f10fae4711ee037d42409ba6ccdb039be Mon Sep 17 00:00:00 2001 From: Christopher Browne Date: Wed, 26 Oct 2011 12:28:16 -0400 Subject: [PATCH 4/7] Remove ancient history that was version-specific to now-rather-old versions --- HISTORY-1.1 | 1779 --------------------------------------------------- RELEASE-2.0 | 229 ------- 2 files changed, 2008 deletions(-) delete mode 100644 HISTORY-1.1 delete mode 100644 RELEASE-2.0 diff --git a/HISTORY-1.1 b/HISTORY-1.1 deleted file mode 100644 index cd9bcaf4..00000000 --- a/HISTORY-1.1 +++ /dev/null @@ -1,1779 +0,0 @@ -2004-10-28 xfade configure,config/acx_libpq.m4 -Configure options should override the default searchpath. - -================================= - -2004-11-02 darcyb share/slon.conf-sample -Include a sample documented slon config file, Thanks Ed L. for the initail work - -================================= - -2004-11-02 darcyb GNUmakefile.in,share/Makefile -install the sample conf, when doing a make install - -================================= - -2004-11-08 cbbrowne src/backend/slony1_base.sql -Added documentation on columns that were not previously documented - -================================= - -2004-11-10 cbbrowne src/backend/slony1_funcs.c,src/backend/slony1_funcs.sql -Fixed typos, added further schema documentation to C functions - -================================= - -2004-11-10 cbbrowne src/backend/slony1_funcs.sql -Add in "draft" version of RebuildListenEntries() that generates -sl_listen entries automatically whenever sl_path and sl_subscribe -change - -================================= - -2004-11-10 cbbrowne doc/adminguide/README,doc/adminguide/SlonyAddThings.txt,doc/adminguide/SlonyAdministrationScripts.txt,doc/adminguide/SlonyConcepts.txt,doc/adminguide/SlonyDDLChanges.txt,doc/adminguide/SlonyDefineCluster.txt,doc/adminguide/SlonyDefineSet.txt,doc/adminguide/SlonyDropThings.txt,doc/adminguide/SlonyFAQ.txt,doc/adminguide/SlonyFAQ01.txt,doc/adminguide/SlonyFAQ02.txt,doc/adminguide/SlonyFAQ03.txt,doc/adminguide/SlonyFAQ04.txt,doc/adminguide/SlonyFAQ05.txt,doc/adminguide/SlonyFAQ06.txt,doc/adminguide/SlonyFAQ07.txt,doc/adminguide/SlonyFAQ08.txt,doc/adminguide/SlonyFAQ09.txt,doc/adminguide/SlonyFAQ10.txt,doc/adminguide/SlonyFAQ11.txt,doc/adminguide/SlonyFAQ12.txt,doc/adminguide/SlonyFAQ13.txt,doc/adminguide/SlonyFAQ14.txt,doc/adminguide/SlonyFAQ15.txt,doc/adminguide/SlonyFAQ16.txt,doc/adminguide/SlonyFAQ17.txt,doc/adminguide/SlonyFAQ18.txt,doc/adminguide/SlonyHandlingFailover.txt,doc/adminguide/SlonyHelp.txt,doc/adminguide/SlonyHowtoFirstTry.txt,doc/adminguide/SlonyIAdministration.txt,doc/adminguide/SlonyInstallation.txt,doc/adminguide/SlonyIntroduction.txt,doc/adminguide/SlonyListenPaths.txt,doc/adminguide/SlonyListenerCosts.txt,doc/adminguide/SlonyMaintenance.txt,doc/adminguide/SlonyPrerequisites.txt,doc/adminguide/SlonyReshapingCluster.txt,doc/adminguide/SlonySlonConfiguration.txt,doc/adminguide/SlonySlonik.txt,doc/adminguide/SlonyStartSlons.txt -Add in material from Slony-I wiki that will become an "Administration -Guide." - -================================= - -2004-11-12 cbbrowne src/ducttape/test_1_pgbench,src/ducttape/test_2_pgbench,src/ducttape/test_3_pgbench,src/ducttape/test_4_pgbench,src/ducttape/test_5_pgbench -Make "ducttape" scripts that use pgbench aware of varying GNU Make names - -================================= - -2004-11-12 cbbrowne src/backend/slony1_funcs.sql -Add FUNCTION generate_sync_event () - to try to add SYNCs even if slon isn't running - -================================= - -2004-11-13 wieck src/backend/slony1_funcs.sql,src/ducttape/test_1_pgbench,src/ducttape/test_2_pgbench,src/slon/local_listen.c,src/slon/remote_worker.c,src/slon/runtime_config.c,src/slon/slon.c,src/slon/slon.h -Here is a first full functional and activated rebuiltListenEntries(). -Any change to sl_node, sl_path and sl_subscribe causes slon to reload -the listen configuration. The logic is slightly different from what -was first discussed and probably not in its final state. But it passes -various configurations without any need to restart slon. - -Jan - -================================= - -2004-11-18 cbbrowne src/ducttape/test_6_autolisten -A gratuitously complex test case which generates 6 nodes, and -uses rebuildlistenentries() to generate the listen network - -================================= - -2004-11-19 cbbrowne doc/howto/slony-I-basic-mstr-slv.txt -Basic tutorial now allows having Slony-I nodes on separate hosts - -================================= - -2004-11-19 cbbrowne tools/altperl/create_set.pl,tools/altperl/init_cluster.pl -These scripts were at one point generating multiple slonik -scripts to set up clusters/sets. - -As they only generate a single script, they now do so via one -opening of files, and don't bother having multiple preambles - -================================= - -2004-11-19 cbbrowne src/backend/slony1_base.sql,src/backend/slony1_funcs.c,src/backend/slony1_funcs.sql -Comments for sl_setsync, revisions to generate_sync_event(), new table maintenance function, add_missing_table_field(), textual and comment changes - -================================= - -2004-11-23 cbbrowne tools/altperl/reset_cluster.pl -The "reset_cluster.pl" script is broken and should become unnecessary -in 1.1... - -================================= - -2004-11-25 darcyb src/backend/slony1_funcs.sql -Make cbbrowne's functions work as conceptualy intended - -================================= - -2004-11-25 cbbrowne src/ducttape/test_1_pgbench,src/ducttape/test_2_pgbench,src/ducttape/test_3_pgbench,src/ducttape/test_4_pgbench,src/ducttape/test_5_pgbench -sh portability change - Use [ -z $WHATEVER ] ; rather than [[ $WHATEVER == "" ]]; - -================================= - -2004-11-25 cbbrowne tools/generate_syncs.sh -branches: 1.1.2; -Add in "generate_syncs.sh" script to use the new "generate_sync_event()" procedure that can generate SYNCs even if the origin's slon is down. - -================================= - -2004-11-25 darcyb src/backend/slony1_funcs.sql -supply missing arg to function comment, make function parse properly - -================================= - -2004-11-25 darcyb src/backend/slony1_funcs.sql -Add a missing ' to correct parse error - -================================= - -2004-11-26 darcyb src/slon/conf-file.sample -Duplicate file, share/slon.conf-sample is the correct home for this - -================================= - -2004-11-29 darcyb src/slon/confoptions.c,src/slon/confoptions.h -Make it possible to easly obtain the value of a conf option - -================================= - -2004-12-01 darcyb src/slon/Makefile -clean should yank the corefile too - -================================= - -2004-12-01 wieck src/backend/slony1_base.sql,src/backend/slony1_funcs.sql,src/ducttape/test_1_update_functions,src/slonik/slonik.c -Added new function upgradeSchema(old_version). Slonik now determines -the currently loaded slony1_funcs.sql version by calling slonyVersion() -before updating the functions. It then calls upgradeSchema(old_version) -so that this function can perform all the required modifications to the -slony1_base schema depending on the old version. - -Jan - -================================= - -2004-12-02 wieck src/backend/slony1_funcs.sql,src/slon/remote_worker.c,src/slonik/parser.y,src/slonik/scan.l,src/slonik/slonik.c,src/slonik/slonik.h -Added option "spoolnode = yes/no" to "store node" command. -If spoolnode=yes is specified, the sl_node entry will have -no_spool=true and slonik does not attempt to initialize a -database for it. - -Jan - -================================= - -2004-12-02 cbbrowne README -Changes reflecting the build changes in 1.1 - -================================= - -2004-12-02 cbbrowne doc/howto/slonik_commands.html -Minor rewordings - -================================= - -2004-12-02 wieck src/backend/slony1_funcs.sql,src/slonik/slonik.c -Changed so that subscribeSet() is called on the data provider -instead of the receiver. It should finally be called on the -set origin and replace ENABLE SUBSCRIPTION entirely, but that -is a way bigger change. With what we have so far it is possible -to create and subscribe a virtual spool node. - -Jan - -================================= - -2004-12-02 cbbrowne tools/altperl/move_set.pl -Remove unnecessary UNLOCK SET from move set script - -================================= - -2004-12-02 cbbrowne src/slon/README -Added overview of what the components of slon do - -================================= - -2004-12-02 wieck doc/howto/slonik_commands.html -Added spoolnode option to slonik command doc. - -Jan - -================================= - -2004-12-03 wieck src/slonik/slonik.c -Create confirm records for all old events when slonik creates -a spool node. - -Jan - -================================= - -2004-12-04 cbbrowne tools/altperl/slon-tools.pm,tools/altperl/slon_watchdog2.pl -Added in node_is_subscribing() function to make watchdog less aggressive about restarting slon nodes - -If a node is in the process of being subscribed, then you can get -long-running COPY requests that run for hours (this happens if it's a -very large database). - -slon_watchdog2.pl therefore has two criteria to use to "throttle" its -slon; thus if there has not been a local event on the node in the -interval $killafter, then it will kill (and ultimately restart) the slon -UNLESS a subscription is in progress. - -================================= - -2004-12-06 cbbrowne doc/adminguide/Makefile,doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/cluster.sgml,doc/adminguide/concepts.sgml,doc/adminguide/ddlchanges.sgml,doc/adminguide/defineset.sgml,doc/adminguide/dropthings.sgml,doc/adminguide/failover.sgml,doc/adminguide/filelist.sgml,doc/adminguide/firstdb.sgml,doc/adminguide/help.sgml,doc/adminguide/installation.sgml,doc/adminguide/intro.sgml,doc/adminguide/legal.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/prerequisites.sgml,doc/adminguide/reshape.sgml,doc/adminguide/slonconfig.sgml,doc/adminguide/slonik.sgml,doc/adminguide/slony.sgml,doc/adminguide/startslons.sgml,doc/adminguide/stylesheet-hh.xsl,doc/adminguide/stylesheet.css,doc/adminguide/stylesheet.dsl,doc/adminguide/stylesheet.xsl,doc/adminguide/subscribenodes.sgml -Transformed all Wiki material aside from the FAQ into DocBook SGML - -================================= - -2004-12-07 darcyb config/acx_pthread.m4 -Prefer -lpthread to -pthread on systems that support it (FreeBSD 5.X and newer) - -================================= - -2004-12-07 darcyb aclocal.m4,configure,configure.ac,config/docbook.m4,config/docs.m4 -add docbook tools to configure, add tools to build the concept docs (and friends) to configure as well - -================================= - -2004-12-07 darcyb Makefile.global.in,configure.ac,config/docbook.m4 -Make cbb's docbook stuff fit into our build env - -================================= - -2004-12-10 cbbrowne doc/howto/slonik_commands.html -Fix to table of contents - SET MOVE (TABLE|SEQUENCE) was indexed as SET DROP - -================================= - -2004-12-10 cbbrowne doc/adminguide/faq.sgml -Add in FAQ to the admin guide - -================================= - -2004-12-10 darcyb Makefile.global.in,configure,config/acx_pthread.m4,src/slon/Makefile -Cleanup linking not done messages when compiling on FreeBSD 5 and 6 - -================================= - -2004-12-10 cbbrowne tools/altperl/slon-tools.pm,tools/altperl/slon_watchdog2.pl -Made watchdog2 smarter - -Instead of just "thumping" a slon once the latest _originating_ events -get pretty old, it now bases the decision on the time of the latest -_confirmation_ of an event from the provider... - -================================= - -2004-12-10 cbbrowne doc/adminguide/Makefile,doc/adminguide/SlonyAddThings.txt,doc/adminguide/SlonyAdministrationScripts.txt,doc/adminguide/SlonyConcepts.txt,doc/adminguide/SlonyDDLChanges.txt,doc/adminguide/SlonyDefineCluster.txt,doc/adminguide/SlonyDefineSet.txt,doc/adminguide/SlonyDropThings.txt,doc/adminguide/SlonyFAQ.txt,doc/adminguide/SlonyFAQ01.txt,doc/adminguide/SlonyFAQ02.txt,doc/adminguide/SlonyFAQ03.txt,doc/adminguide/SlonyFAQ04.txt,doc/adminguide/SlonyFAQ05.txt,doc/adminguide/SlonyFAQ06.txt,doc/adminguide/SlonyFAQ07.txt,doc/adminguide/SlonyFAQ08.txt,doc/adminguide/SlonyFAQ09.txt,doc/adminguide/SlonyFAQ10.txt,doc/adminguide/SlonyFAQ11.txt,doc/adminguide/SlonyFAQ12.txt,doc/adminguide/SlonyFAQ13.txt,doc/adminguide/SlonyFAQ14.txt,doc/adminguide/SlonyFAQ15.txt,doc/adminguide/SlonyFAQ16.txt,doc/adminguide/SlonyFAQ17.txt,doc/adminguide/SlonyFAQ18.txt,doc/adminguide/SlonyHandlingFailover.txt,doc/adminguide/SlonyHelp.txt,doc/adminguide/SlonyHowtoFirstTry.txt,doc/adminguide/SlonyIAdministration.txt,doc/adminguide/SlonyInstallation.txt,doc/adminguide/SlonyIntroduction.txt,doc/adminguide/SlonyListenPaths.txt,doc/adminguide/SlonyListenerCosts.txt,doc/adminguide/SlonyMaintenance.txt,doc/adminguide/SlonyPrerequisites.txt,doc/adminguide/SlonyReshapingCluster.txt,doc/adminguide/SlonySlonConfiguration.txt,doc/adminguide/SlonySlonik.txt,doc/adminguide/SlonyStartSlons.txt,doc/adminguide/addthings.html,doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/altperl.html,doc/adminguide/cluster.html,doc/adminguide/cluster.sgml,doc/adminguide/concepts.html,doc/adminguide/concepts.sgml,doc/adminguide/ddlchanges.html,doc/adminguide/ddlchanges.sgml,doc/adminguide/defineset.sgml,doc/adminguide/dropthings.html,doc/adminguide/dropthings.sgml,doc/adminguide/failover.html,doc/adminguide/failover.sgml,doc/adminguide/faq.html,doc/adminguide/filelist.sgml,doc/adminguide/firstdb.html,doc/adminguide/firstdb.sgml,doc/adminguide/help.html,doc/adminguide/help.sgml,doc/adminguide/installation.html,doc/adminguide/installation.sgml,doc/adminguide/intro.sgml,doc/adminguide/legal.sgml,doc/adminguide/listenpaths.html,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.html,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.html,doc/adminguide/monitoring.sgml,doc/adminguide/mysheet.dsl,doc/adminguide/prerequisites.sgml,doc/adminguide/requirements.html,doc/adminguide/reshape.html,doc/adminguide/reshape.sgml,doc/adminguide/slonconfig.html,doc/adminguide/slonconfig.sgml,doc/adminguide/slonik.html,doc/adminguide/slonik.sgml,doc/adminguide/slonstart.html,doc/adminguide/slony.html,doc/adminguide/slony.sgml,doc/adminguide/startslons.sgml,doc/adminguide/subscribenodes.html,doc/adminguide/subscribenodes.sgml,doc/adminguide/t24.html,doc/adminguide/x267.html,doc/adminguide/x931.html -Wiki data transformed to DocBook/SGML - -================================= - -2004-12-10 cbbrowne doc/adminguide/adminscripts.sgml,doc/adminguide/cluster.sgml,doc/adminguide/concepts.sgml,doc/adminguide/defineset.sgml,doc/adminguide/dropthings.sgml,doc/adminguide/failover.sgml,doc/adminguide/firstdb.sgml,doc/adminguide/help.sgml,doc/adminguide/installation.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/reshape.sgml,doc/adminguide/slonconfig.sgml,doc/adminguide/subscribenodes.sgml -Fix up formatting of inclusions in documentation set - -================================= - -2004-12-10 darcyb src/slon/confoptions.c - -Fix cast to pointer from integer of different size on 64bit platforms - -================================= - -2004-12-10 darcyb src/slon/conf-file.h,src/slon/slon.h -Remove warning of ProcessConfigFile not defined. - -================================= - -2004-12-11 darcyb src/slon/Makefile,src/slonik/Makefile -Clean up maintainer-clean to remove the generated yacc/lex output - -================================= - -2004-12-11 darcyb src/slon/Makefile -Remove a not yet commited thread from building - -================================= - -2004-12-11 darcyb doc/Makefile -Build documentation - -================================= - -2004-12-13 darcyb src/backend/slony1_funcs.sql -Fix patch/diff's braindead off by 2 lines error - -================================= - -2004-12-13 darcyb Makefile,aclocal.m4,configure,configure.ac,config/compiler.m4,config/general.m4 -Some more minor cleanups in the build environment, make building with debuging symbols optional - -================================= - -2004-12-13 cbbrowne doc/adminguide/addthings.html,doc/adminguide/bookindex.sgml,doc/adminguide/cluster.html,doc/adminguide/concepts.html,doc/adminguide/ddlchanges.html,doc/adminguide/defineset.sgml,doc/adminguide/dropthings.html,doc/adminguide/failover.html,doc/adminguide/faq.html,doc/adminguide/faq.sgml,doc/adminguide/filelist.sgml,doc/adminguide/firstdb.html,doc/adminguide/firstdb.sgml,doc/adminguide/help.html,doc/adminguide/help.sgml,doc/adminguide/installation.html,doc/adminguide/listenpaths.html,doc/adminguide/maintenance.html,doc/adminguide/monitoring.html,doc/adminguide/reference.sgml,doc/adminguide/requirements.html,doc/adminguide/reshape.html,doc/adminguide/slon.sgml,doc/adminguide/slonconfig.sgml,doc/adminguide/slonik.html,doc/adminguide/slonik.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/slonstart.html,doc/adminguide/slony.html,doc/adminguide/slony.sgml,doc/adminguide/subscribenodes.html -Plenty of updates to documentation; consolidated in man pages for slon/slonik - -================================= - -2004-12-13 darcyb doc/howto/slonik_commands.html,src/backend/slony1_base.sql,src/backend/slony1_funcs.sql,src/slon/misc.c,src/slon/remote_worker.c,src/slon/slon.c,src/slonik/parser.y,src/slonik/scan.l,src/slonik/slonik.c,src/slonik/slonik.h -Due to lots of SIC regarding the pg_dump safe patches, I'll commit them. - -New functionality allows you to REPAIR CONFIG() a node(s) after you have used pg_dump/restore on them. -slonik has a new statement REPAIR CONFIG(), and a new event class has been created REPAIR_CONFIG. - -================================= - -2004-12-13 darcyb src/slon/confoptions.c,src/slon/confoptions.h,src/slon/slon.c -Cleanup some more compiler warnings - -================================= - -2004-12-14 cbbrowne doc/adminguide/addthings.html,doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/app-slon.html,doc/adminguide/app-slonik.html,doc/adminguide/cluster.html,doc/adminguide/cluster.sgml,doc/adminguide/concepts.html,doc/adminguide/concepts.sgml,doc/adminguide/ddlchanges.html,doc/adminguide/ddlchanges.sgml,doc/adminguide/defineset.sgml,doc/adminguide/definingsets.html,doc/adminguide/dropthings.html,doc/adminguide/dropthings.sgml,doc/adminguide/failover.html,doc/adminguide/failover.sgml,doc/adminguide/faq.html,doc/adminguide/faq.sgml,doc/adminguide/firstdb.html,doc/adminguide/firstdb.sgml,doc/adminguide/help.html,doc/adminguide/help.sgml,doc/adminguide/installation.html,doc/adminguide/installation.sgml,doc/adminguide/listenpaths.html,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.html,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.html,doc/adminguide/monitoring.sgml,doc/adminguide/prerequisites.sgml,doc/adminguide/requirements.html,doc/adminguide/reshape.html,doc/adminguide/reshape.sgml,doc/adminguide/slon.sgml,doc/adminguide/slonik.sgml,doc/adminguide/slonstart.html,doc/adminguide/slony-commands.html,doc/adminguide/slony.html,doc/adminguide/slonyadmin.html,doc/adminguide/slonyintro.html,doc/adminguide/startslons.sgml,doc/adminguide/subscribenodes.html,doc/adminguide/subscribenodes.sgml -Enormous SGML cleanup/improvement - -================================= - -2004-12-15 cbbrowne doc/adminguide/adminscripts.sgml,doc/adminguide/faq.sgml,doc/adminguide/listenpaths.sgml -Added in docs on new Perl script to generate SET LISTEN requests - -================================= - -2004-12-15 cbbrowne tools/altperl/regenerate-listens.pl -regenerate-listens.pl - Perl script that generates Slonik "SET LISTEN" entries -based on the contents of a running Slony-I cluster. - -Documentation to follow in the next CVS commit... - -================================= - -2004-12-16 cbbrowne doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/cluster.sgml,doc/adminguide/concepts.sgml,doc/adminguide/ddlchanges.sgml,doc/adminguide/defineset.sgml,doc/adminguide/dropthings.sgml,doc/adminguide/failover.sgml,doc/adminguide/faq.sgml,doc/adminguide/filelist.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/reference.sgml,doc/adminguide/reshape.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/startslons.sgml,doc/adminguide/subscribenodes.sgml -Added full Slonik reference in DocBook form, along with a rich set of -linkages to it in the other materials in the admin guide. - -================================= - -2004-12-17 darcyb configure -make the features in the previous commit available - -================================= - -2004-12-17 darcyb src/backend/slony1_funcs.sql -More diff crazyness repairs - -================================= - -2004-12-17 darcyb doc/adminguide/Makefile -Add schemadoc building support - -================================= - -2004-12-17 darcyb aclocal.m4,configure.ac,config/docbook.m4,config/docs.m4 -More docbook fixes, detect the correct version of docbook (4.2) - -================================= - -2004-12-17 darcyb doc/adminguide/filelist.sgml,doc/adminguide/localxid.sql,doc/adminguide/schemadoc.xml,doc/adminguide/slony.sgml -Add Internals section, this section has a references of all the tables/views and functions used internaly by slony-I. localxxid is a copy of that found in the how-to directory. - -================================= - -2004-12-17 darcyb Makefile.global.in,configure.ac,doc/Makefile,doc/adminguide/Makefile -More build environment changes to better support cbrowne's docbook work. - -================================= - -2004-12-20 darcyb doc/adminguide/Makefile,doc/adminguide/slony.sgml -collateindex is handled by ./configure no need to attempt to override it here - -================================= - -2004-12-20 darcyb doc/adminguide/SlonyAddThings.txt,doc/adminguide/SlonyAdministrationScripts.txt,doc/adminguide/SlonyConcepts.txt,doc/adminguide/SlonyDDLChanges.txt,doc/adminguide/SlonyDefineCluster.txt,doc/adminguide/SlonyDefineSet.txt,doc/adminguide/SlonyDropThings.txt,doc/adminguide/SlonyFAQ.txt,doc/adminguide/SlonyFAQ01.txt,doc/adminguide/SlonyFAQ02.txt,doc/adminguide/SlonyFAQ03.txt,doc/adminguide/SlonyFAQ04.txt,doc/adminguide/SlonyFAQ05.txt,doc/adminguide/SlonyFAQ06.txt,doc/adminguide/SlonyFAQ07.txt,doc/adminguide/SlonyFAQ08.txt,doc/adminguide/SlonyFAQ09.txt,doc/adminguide/SlonyFAQ10.txt,doc/adminguide/SlonyFAQ11.txt,doc/adminguide/SlonyFAQ12.txt,doc/adminguide/SlonyFAQ13.txt,doc/adminguide/SlonyFAQ14.txt,doc/adminguide/SlonyFAQ15.txt,doc/adminguide/SlonyFAQ16.txt,doc/adminguide/SlonyFAQ17.txt,doc/adminguide/SlonyFAQ18.txt,doc/adminguide/SlonyHandlingFailover.txt,doc/adminguide/SlonyHelp.txt,doc/adminguide/SlonyHowtoFirstTry.txt,doc/adminguide/SlonyIAdministration.txt,doc/adminguide/SlonyInstallation.txt,doc/adminguide/SlonyIntroduction.txt,doc/adminguide/SlonyListenPaths.txt,doc/adminguide/SlonyListenerCosts.txt,doc/adminguide/SlonyMaintenance.txt,doc/adminguide/SlonyPrerequisites.txt,doc/adminguide/SlonyReshapingCluster.txt,doc/adminguide/SlonySlonConfiguration.txt,doc/adminguide/SlonySlonik.txt,doc/adminguide/SlonyStartSlons.txt -Time to box the text files up and move them to the attic - -================================= - -2004-12-21 cbbrowne doc/adminguide/slonik_ref.sgml -Moved preamble material a bit to indicate that echo can't be used -in the "preamble" of a Slonik script - -================================= - -2004-12-21 darcyb doc/adminguide/Makefile,doc/adminguide/filelist.sgml,doc/adminguide/stylesheet.css,doc/adminguide/stylesheet.dsl -use the correct dsl when building docs - -================================= - -2004-12-21 darcyb doc/adminguide/Makefile,doc/adminguide/adminscripts.sgml,doc/adminguide/installation.sgml,doc/adminguide/intro.sgml,doc/adminguide/prerequisites.sgml,doc/adminguide/reference.sgml,doc/adminguide/schemadoc.xml,doc/adminguide/slonik_ref.sgml,doc/adminguide/slony.sgml -Convert book to parts + chapters - -================================= - -2004-12-22 cbbrowne doc/adminguide/slonik_ref.sgml -Put in proper entries for each Slonik command - -================================= - -2004-12-22 cbbrowne doc/adminguide/slonik.sgml -Point to internal Slonik command reference, not the GBorg web site - -================================= - -2004-12-22 darcyb doc/adminguide/Makefile,doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/app-slon.html,doc/adminguide/app-slonik.html,doc/adminguide/bookindex.sgml,doc/adminguide/cluster.html,doc/adminguide/cluster.sgml,doc/adminguide/concepts.html,doc/adminguide/concepts.sgml,doc/adminguide/ddlchanges.sgml,doc/adminguide/defineset.sgml,doc/adminguide/definingsets.html,doc/adminguide/dropthings.sgml,doc/adminguide/failover.sgml,doc/adminguide/faq.html,doc/adminguide/faq.sgml,doc/adminguide/firstdb.sgml,doc/adminguide/help.sgml,doc/adminguide/installation.html,doc/adminguide/installation.sgml,doc/adminguide/intro.sgml,doc/adminguide/legal.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/prerequisites.sgml,doc/adminguide/reference.sgml,doc/adminguide/requirements.html,doc/adminguide/reshape.sgml,doc/adminguide/schemadoc.xml,doc/adminguide/slon.sgml,doc/adminguide/slonik.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/slony.sgml,doc/adminguide/slonyadmin.html,doc/adminguide/slonyintro.html,doc/adminguide/startslons.sgml,doc/adminguide/subscribenodes.sgml -Building of schemadoc.xml now removes the local schema name, (allow for better portability between developers), update the embeded references in faq to make use of this convention. add Id tages to all the sgml files. - -================================= - -2004-12-22 darcyb Makefile.global.in -Carry the docbook stuff through to the frontend - -================================= - -2004-12-22 cbbrowne doc/adminguide/prerequisites.sgml -SGML tagging fixes - -================================= - -2004-12-22 darcyb doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/bookindex.sgml,doc/adminguide/cluster.sgml,doc/adminguide/concepts.sgml,doc/adminguide/ddlchanges.sgml,doc/adminguide/defineset.sgml,doc/adminguide/dropthings.sgml,doc/adminguide/failover.sgml,doc/adminguide/faq.sgml,doc/adminguide/firstdb.sgml,doc/adminguide/help.sgml,doc/adminguide/installation.sgml,doc/adminguide/intro.sgml,doc/adminguide/legal.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/prerequisites.sgml,doc/adminguide/reference.sgml,doc/adminguide/reshape.sgml,doc/adminguide/slon.sgml,doc/adminguide/slonik.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/slony.sgml,doc/adminguide/startslons.sgml,doc/adminguide/subscribenodes.sgml -Validate using make check - -================================= - -2004-12-22 darcyb configure -More docbook tweeks - -================================= - -2004-12-22 cbbrowne doc/adminguide/faq.sgml -Added commentary on what happens to triggers and rules - -================================= - -2004-12-22 cbbrowne doc/adminguide/monitoring.sgml -Built a variablelist to list different threads that generate log messages - -================================= - -2004-12-22 cbbrowne doc/adminguide/adminscripts.sgml -Regrouped sections; doesn't need to be split into a bunch of pages... - -================================= - -2005-01-03 wieck configure -new configure script based on last acx_pthread.m4 change. - -Jan - -================================= - -2005-01-03 wieck tools/Makefile,tools/slony1_extract_schema.sh -Added script to extract the user schema (without slony cruft) -from an existing node. The node must be the origin. - -Jan - -================================= - -2005-01-03 wieck config/acx_pthread.m4 -Don't know why actually using the pthread ld flags was commented out, -but I suppose it would break more platforms than just FreeBSD 4.9. - -Jan - -================================= - -2005-01-04 cbbrowne tools/altperl/slon_start.pl -Add in startup script changes from Steve Simms... - -- Support long option names -- Optionally don't start a watchdog -- Optionally specify where slon.env is -- Nodes can be specified in either the form "node123" or "123" - -================================= - -2005-01-04 cbbrowne tools/altperl/slon-tools.pm -Add in support for SSL connections - -Thanks to Steve Simms - -================================= - -2005-01-07 cbbrowne doc/adminguide/maintenance.sgml,tools/log.pm,tools/run_rep_tests.sh,tools/test_slony_replication.pl -Added Perl/Bash scripts for testing how Slony-I replication is running. - -Also added documentation on these scripts to the Admin guide. - -================================= - -2005-01-10 cbbrowne tools/altperl/drop_set.pl -Add Steve Simms usage, allow nodes to be 123 rather than node123 - -================================= - -2005-01-10 cbbrowne tools/altperl/init_cluster.pl -Changes from Steve Simms to "init_cluster.pl" - - Allow location of tool config to be specified in the environment - - Have output that shouldn't go to Slonik be #commented out - -================================= - -2005-01-10 cbbrowne tools/altperl/subscribe_set.pl -Steve Simms changes - subscribe_set.pl - add usage printout, allow node to be -called 123 as well as node123 - -================================= - -2005-01-10 cbbrowne tools/altperl/slon_kill.pl -Add usage output - -Potentially use environment to determine where cluster information is - -Turn reused logic into a function - -================================= - -2005-01-10 cbbrowne tools/altperl/README,tools/altperl/slon.env -Have a sequence parameter, $SEQUENCE_ID, to manage sequence IDs just like $TABLE_ID does for tables - -================================= - -2005-01-10 darcyb doc/adminguide/filelist.sgml,doc/adminguide/slonconf.sgml -document slon.conf configuration - -================================= - -2005-01-10 cbbrowne tools/altperl/create_set.pl -Use $SEQUENCE_ID rather than $SEQID, which will become an environment parameter. - -Change suggested by Steve Simms - -================================= - -2005-01-10 cbbrowne tools/altperl/merge_sets.pl -Steve Simms changes - have usage, common config parameter, allow nodes -to be called 123 as well as node123 - -================================= - -2005-01-10 cbbrowne doc/adminguide/slon.sgml,src/slon/confoptions.h,src/slon/remote_worker.c,src/slon/slon.c -Added a dynamic SYNC group "windowing" scheme, along with docs and -configuration option code. - -This allows defining a target "desired_sync_time", defaulting to 1 -minute, where, if replication is behind, slon will gradually increase -sync group sizes to try to get the expected time for the group to -take that period of time. - -It backs off IMMEDIATELY, if there is a large or long running SYNC, -and starts at 1, and increases group sizes by the greater of 1 and -10% of the last group size. Once the node gets up to date, that -also causes it to back off to sync sizes of 1 or 2. - -This makes it reasonable to have the maximum sync grouping set rather -high, as the groups will only get large gradually, in keeping with -how the system is performing. - -================================= - -2005-01-11 darcyb doc/adminguide/slonconf.sgml,share/slon.conf-sample -Document cbb's newly added desired_sync_time config option. - -================================= - -2005-01-12 cbbrowne doc/adminguide/faq.sgml -Add in discussion of the "long running idle transaction" problem. - -================================= - -2005-01-12 darcyb src/slon/cleanup_thread.c -fix copy/paste typo for deleteing from sl_log_* tables. - -================================= - -2005-01-12 cbbrowne doc/adminguide/reshape.sgml -Cleaned up SGML tagging a bit - -================================= - -2005-01-12 darcyb src/backend/slony1_funcs.c,src/slon/cleanup_thread.c,src/slon/conf-file.h,src/slon/confoptions.c,src/slon/confoptions.h,src/slon/dbutils.c,src/slon/local_listen.c,src/slon/misc.c,src/slon/misc.h,src/slon/remote_listen.c,src/slon/remote_worker.c,src/slon/runtime_config.c,src/slon/scheduler.c,src/slon/slon.c,src/slon/slon.h,src/slon/sync_thread.c,src/slonik/dbutil.c,src/slonik/slonik.c,src/slonik/slonik.h,src/xxid/xxid.c -pgindent run - -================================= - -2005-01-17 cbbrowne tools/altperl/slon_kill.pl -Mods per Steve Simms... - - I also moved the "require $SLON_ENV_FILE" to a point *after* - the usage statement, so that it doesn't croak if slon.env isn't - present. - -================================= - -2005-01-18 cbbrowne doc/adminguide/faq.sgml,doc/adminguide/monitoring.sgml,tools/test_slony_state.pl -Added in a script to test the state of a Slony-I cluster, along with -some documentation - -================================= - -2005-01-18 cbbrowne doc/adminguide/faq.sgml -Added docs for a condition which breaks replication triggers - -================================= - -2005-01-18 cbbrowne doc/adminguide/ddlchanges.sgml,doc/adminguide/slonik_ref.sgml -Added some "best practices" material concerning how to better cope -with DDL changes. - -This also pointed to documenting more precisely what the Slonik -"execute script" command does. - -================================= - -2005-01-19 darcyb share/DBITECH-SLONY-I-MIB.txt -Beginnings of snmp status and management interface for Slony - -================================= - -2005-01-21 darcyb share/DBITECH-SLONY-I-MIB.txt -Fix 2 typo's as pointed out by mastermind. - -================================= - -2005-01-23 cbbrowne doc/adminguide/faq.sgml,doc/adminguide/intro.sgml,doc/adminguide/listenpaths.sgml -Added FAQ entry, revised intro (textual revisions), fixed formatting of -listenpaths.sgml a bit - -================================= - -2005-01-24 cbbrowne doc/adminguide/README,doc/adminguide/addthings.html,doc/adminguide/altperl.html,doc/adminguide/app-slon.html,doc/adminguide/app-slonik.html,doc/adminguide/cluster.html,doc/adminguide/concepts.html,doc/adminguide/ddlchanges.html,doc/adminguide/definingsets.html,doc/adminguide/dropthings.html,doc/adminguide/failover.html,doc/adminguide/faq.html,doc/adminguide/firstdb.html,doc/adminguide/help.html,doc/adminguide/installation.html,doc/adminguide/listenpaths.html,doc/adminguide/maintenance.html,doc/adminguide/monitoring.html,doc/adminguide/requirements.html,doc/adminguide/reshape.html,doc/adminguide/slonconfig.html,doc/adminguide/slonik.html,doc/adminguide/slonstart.html,doc/adminguide/slony-commands.html,doc/adminguide/slony.html,doc/adminguide/slonyadmin.html,doc/adminguide/slonyintro.html,doc/adminguide/subscribenodes.html,doc/adminguide/t24.html,doc/adminguide/x267.html,doc/adminguide/x931.html -Apply changes from CVS HEAD admin guide into the stable branch as this -material will be useful for both versions - -================================= - -2005-01-24 cbbrowne doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/concepts.sgml,doc/adminguide/faq.sgml,doc/adminguide/help.sgml,doc/adminguide/intro.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/prerequisites.sgml,doc/adminguide/reference.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/slony.sgml -Plenty of modifications to documentation; lots of textual changes. - -================================= - -2005-01-25 cbbrowne tools/altperl/slon_start.pl,tools/altperl/slon_watchdog.pl -slon_watchdog.pl.diff -- Added --config and --help options, as with other files -- Use a while loop instead of a recursive function for the watchdog process -- Allow node# to be given as just a number, as with other files - -slon_start.pl.diff -- --help would fail if --config wasn't specified and slon.env wasn't in @INC -- Call slon_watchdog.pl using --config - --- -Steve Simms - -================================= - -2005-01-26 darcyb src/slon/Makefile -Check for FLEX and bail if not present - -================================= - -2005-01-26 darcyb Makefile.global.in,aclocal.m4,configure.ac,config/perl.m4 -Clean up detection of lex/yacc as well as check for perl's location - -================================= - -2005-01-26 darcyb configure -Bring sed detection forward - -================================= - -2005-01-26 darcyb Makefile.global.in,configure.ac -Add proper detection of sed since slonik relies on haveing sed available - -================================= - -2005-01-26 darcyb configure -Bring the previous configure.ac commit into the frontend - -================================= - -2005-01-26 darcyb src/slonik/Makefile,src/slonik/slonik.c -Use the detected version of sed - -================================= - -2005-01-26 darcyb tools/altperl/Makefile,tools/altperl/build_env.pl,tools/altperl/create_set.pl,tools/altperl/drop_node.pl,tools/altperl/drop_set.pl,tools/altperl/failover.pl,tools/altperl/init_cluster.pl,tools/altperl/merge_sets.pl,tools/altperl/move_set.pl,tools/altperl/regenerate-listens.pl,tools/altperl/restart_node.pl,tools/altperl/restart_nodes.pl,tools/altperl/show_configuration.pl,tools/altperl/show_nodes.pl,tools/altperl/slon-tools.pm,tools/altperl/slon.env,tools/altperl/slon_kill.pl,tools/altperl/slon_pushsql.pl,tools/altperl/slon_start.pl,tools/altperl/slon_watchdog.pl,tools/altperl/slon_watchdog2.pl,tools/altperl/subscribe_set.pl,tools/altperl/uninstall_nodes.pl,tools/altperl/unsubscribe_set.pl,tools/altperl/update_nodes.pl -Remove non required hash-bangs, and setup hash-bang substitution, provide method to remove .pl from scripts - -================================= - -2005-01-27 cbbrowne src/ducttape/test_1_pgbench_no_node1 -Test where the nodes are numbered 11 and 22 rather than 1 and 2 -to validate that you don't need a node #1 - -================================= - -2005-01-28 cbbrowne src/slon/remote_listen.c -Reformatted function call contents to make indentation consistent - -================================= - -2005-01-28 cbbrowne src/slon/confoptions.h -Allow -t timeout parameter to be as much as 10 minutes long - -================================= - -2005-01-28 cbbrowne doc/adminguide/slon.sgml -Added comments about how SYNCs are not needed nearly as often on -subscriber nodes - -================================= - -2005-01-28 cbbrowne src/slon/remote_worker.c -A reference to last_sync_group_size was missed; added it back - -And some reindentation... - -================================= - -2005-02-01 darcyb configure,configure.ac -Repair variable substitution problem with bison -y (remove trailing ,) - -================================= - -2005-02-02 cbbrowne doc/adminguide/failover.sgml,doc/adminguide/faq.sgml,doc/adminguide/slonik_ref.sgml -Improved discussion of FAILOVER and why it is vital that it abandon the -failed node. - -================================= - -2005-02-02 cbbrowne tools/altperl/README,tools/altperl/create_set.pl,tools/altperl/regenerate-listens.pl,tools/altperl/restart_nodes.pl,tools/altperl/show_configuration.pl,tools/altperl/slon-tools.pm,tools/altperl/slon.env,tools/altperl/slon_kill.pl,tools/altperl/slon_start.pl,tools/altperl/slon_watchdog.pl,tools/altperl/slon_watchdog2.pl,tools/altperl/uninstall_nodes.pl -Patches per Steve Simms to replace $SETNAME with $CLUSTER_NAME which -is really a much more consistent name to use to identify Slony-I -clusters... - -Also, a change by Chris Browne that, for non-users of Apache log rotator, -puts the present timestamp in the name of the log file. That way there's -a rotation of sorts even if it isn't managed by "ALR". - -================================= - -2005-02-02 cbbrowne doc/adminguide/adminscripts.sgml -Alter documentation to reflect the renaming of "$SETNAME" to "$CLUSTER_NAME" -in the admin tools - -================================= - -2005-02-02 cbbrowne doc/adminguide/slony.sgml,doc/adminguide/usingslonik.sgml -Adding in a document to discuss "care and feeding" of embedding slonik -scripts - -================================= - -2005-02-02 cbbrowne tools/altperl/slon.env -Major additions to comments by Steve Simms - -================================= - -2005-02-02 cbbrowne doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/ddlchanges.sgml,doc/adminguide/dropthings.sgml,doc/adminguide/failover.sgml,doc/adminguide/firstdb.sgml,doc/adminguide/help.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/reshape.sgml,doc/adminguide/slon.sgml,doc/adminguide/slonik.sgml,doc/adminguide/slony.sgml,doc/adminguide/startslons.sgml,doc/adminguide/subscribenodes.sgml -Whole bunch of Slony-I sections ought to be treated as a single -
so that the table of contents is generated for the whole -lot of them rather than one for each section - -================================= - -2005-02-02 darcyb TODO -add request for upgrade docs, and more examples. remove cbb wik/fai now that it's intergrated - -================================= - -2005-02-07 cbbrowne doc/adminguide/ddlchanges.sgml -More commentary about pathologies - -================================= - -2005-02-07 cbbrowne doc/adminguide/installation.sgml,doc/adminguide/intro.sgml -Reshaped sectioning a bit to make things flow better - -================================= - -2005-02-07 cbbrowne doc/adminguide/defineset.sgml -Added some comments about how adding lots of sequences gets pathological - -================================= - -2005-02-07 cbbrowne doc/adminguide/prerequisites.sgml -Moved notes about PG 7.2 to new page on doing upgrades using Slony-I - -================================= - -2005-02-07 cbbrowne doc/adminguide/dropthings.sgml,doc/adminguide/plainpaths.sgml,doc/adminguide/slon.sgml,doc/adminguide/slonik.sgml -Added document on handling of plain paths... - -Fixed tagging errors and such in various files - -================================= - -2005-02-07 cbbrowne doc/adminguide/slonik_ref.sgml -Retagging the intro material - -================================= - -2005-02-07 cbbrowne doc/adminguide/filelist.sgml -Added new documents - -================================= - -2005-02-07 cbbrowne doc/adminguide/slony.sgml -Reshaped it so it's only a few parts and a few articles - -================================= - -2005-02-07 cbbrowne doc/adminguide/versionupgrade.sgml -New article on using Slony-I to do version upgrades of PostgreSQL - -================================= - -2005-02-07 cbbrowne doc/adminguide/usingslonik.sgml -Reshaped sections a bit to improve flow of web pages - -================================= - -2005-02-07 cbbrowne doc/adminguide/faq.sgml -Evidently the "dup key" problem isn't SIG 11 and isn't (in an obvious way) -a corrupted index... - -================================= - -2005-02-09 cbbrowne doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/cluster.sgml,doc/adminguide/concepts.sgml,doc/adminguide/ddlchanges.sgml,doc/adminguide/defineset.sgml,doc/adminguide/dropthings.sgml,doc/adminguide/failover.sgml,doc/adminguide/faq.sgml,doc/adminguide/firstdb.sgml,doc/adminguide/help.sgml,doc/adminguide/installation.sgml,doc/adminguide/intro.sgml,doc/adminguide/legal.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/plainpaths.sgml,doc/adminguide/reshape.sgml,doc/adminguide/slon.sgml,doc/adminguide/slonik.sgml,doc/adminguide/slony.sgml,doc/adminguide/startslons.sgml,doc/adminguide/subscribenodes.sgml,doc/adminguide/usingslonik.sgml,doc/adminguide/versionupgrade.sgml -Fix up tagging of documents; did a lot of SGML normalization. - -================================= - -2005-02-09 cbbrowne tools/altperl/regenerate-listens.pl -Vivek Khera updated this to use DBI - -================================= - -2005-02-10 smsimms tools/altperl/show_nodes.pl -This file was just a copy of init_cluster.pl, and had nothing to do -with showing node information. - -================================= - -2005-02-10 smsimms Makefile.global.in,tools/altperl/Makefile -Make sysconfdir and pglibdir available to sed - -These will be used to store the altperl configuration file and -slon-tools.pm - -================================= - -2005-02-10 smsimms doc/adminguide/adminscripts.sgml,tools/altperl/README,tools/altperl/build_env.pl,tools/altperl/create_set.pl,tools/altperl/drop_node.pl,tools/altperl/drop_set.pl,tools/altperl/failover.pl,tools/altperl/init_cluster.pl,tools/altperl/merge_sets.pl,tools/altperl/move_set.pl,tools/altperl/restart_node.pl,tools/altperl/restart_nodes.pl,tools/altperl/show_configuration.pl,tools/altperl/slon.env,tools/altperl/slon_kill.pl,tools/altperl/slon_pushsql.pl,tools/altperl/slon_start.pl,tools/altperl/slon_tools.conf-sample,tools/altperl/slon_watchdog.pl,tools/altperl/slon_watchdog2.pl,tools/altperl/subscribe_set.pl,tools/altperl/uninstall_nodes.pl,tools/altperl/unsubscribe_set.pl,tools/altperl/update_nodes.pl -Use fixed paths for altperl tools configuration and library files. - -The configuration file defaults to the "sysconfdir" argument to -configure (/usr/local/etc by default), and has been renamed to -slon_tools.conf, which seems to go along with the naming convention of -the configuration files in /usr/local/pgsql/data. - -The slon-tools.pm library is installed in the pglibdir path. - -I've also updated the relevant documentation to note the slon.env name -change. - -================================= - -2005-02-10 smsimms tools/altperl/Makefile,tools/altperl/slon_start.pl -Added an "install" target to Makefile. It copies the configuration -file, library, and slon start/stop/watch scripts to their relevant -directories. I'm holding off on the slonik scripts until we decide -where we want them to go. - -Adjusted DISTDIRS to reflect the slon.env -> slon_tools.conf change. - -Added a pgbindir substitution, and modified slon_start.pl so that it -uses that path to get to slon_watchdog. - -================================= - -2005-02-10 smsimms tools/altperl/build_env.pl,tools/altperl/drop_node.pl,tools/altperl/drop_set.pl,tools/altperl/failover.pl,tools/altperl/init_cluster.pl,tools/altperl/merge_sets.pl,tools/altperl/move_set.pl,tools/altperl/restart_node.pl,tools/altperl/restart_nodes.pl,tools/altperl/show_configuration.pl,tools/altperl/show_nodes.pl,tools/altperl/slon_kill.pl,tools/altperl/slon_pushsql.pl,tools/altperl/slon_start.pl,tools/altperl/slon_watchdog.pl,tools/altperl/slon_watchdog2.pl,tools/altperl/subscribe_set.pl,tools/altperl/uninstall_nodes.pl,tools/altperl/unsubscribe_set.pl,tools/altperl/update_nodes.pl -Removed Emacs hints from the #! line, which were preventing the -scripts from running on RH Linux. - -================================= - -2005-02-11 cbbrowne doc/adminguide/faq.sgml,doc/adminguide/prerequisites.sgml -Added documentation about how the slony user needs to not only be a -PostgreSQL "superuser" but to also have system table update privileges. - -================================= - -2005-02-11 darcyb share/Makefile,src/backend/Makefile,src/xxid/Makefile -Install .sql and .conf files as mode 644 not 755 - -================================= - -2005-02-14 cbbrowne doc/adminguide/ddlchanges.sgml -More comments... - -================================= - -2005-02-14 smsimms tools/altperl/Makefile -Make "all" the default target. - -Install slon_start, slon_kill, etc. instead of slon_start.pl, -slon_kill.pl, etc. - -================================= - -2005-02-14 smsimms tools/regenerate-listens.pl,tools/altperl/regenerate-listens.pl -Moved regenerate-listens.pl from tools/altperl to tools. - -================================= - -2005-02-15 cbbrowne doc/adminguide/faq.sgml -Added notes on a "missing OID" problem that can take place if you -drop a cluster but have some connection pool system (common for -Java apps) that keeps around connections that are pointing to -obsolete stored plans. - -================================= - -2005-02-15 cbbrowne doc/adminguide/faq.sgml,doc/adminguide/slonik_ref.sgml -Fix SGML tagging error, add link so that Slonik reference pages -point to the FAQ entry on 'missing OIDs' problem - -================================= - -2005-02-16 darcyb src/backend/slony1_funcs.sql -Fix cluster init, default log shipping to false, with cbb's blessing - -================================= - -2005-02-16 smsimms src/backend/slony1_funcs.sql -Provide a less cryptic error message when you pass a non-existent -tablename to determineIdxnameUnique or determineAttkindUnique. - -================================= - -2005-02-16 smsimms src/backend/slony1_funcs.sql -Add a missing WHERE clause that causes MOVE SET to fail when: - -1. There are three or more nodes -2. Sets originate on at least two nodes -3. A set is being moved from a third node to one of the first two. - -================================= - -2005-02-17 cbbrowne src/ducttape/test_1_pgbench,src/ducttape/test_2_pgbench,src/ducttape/test_3_pgbench,src/ducttape/test_4_pgbench,src/ducttape/test_5_pgbench,src/ducttape/test_6_autolisten -Fix some misspellings - -================================= - -2005-02-17 wieck src/slon/confoptions.h,src/slon/remote_worker.c,src/slon/slon.c,tools/slony1_dump.sh -First cut on the log shipping mechanism. - -The tools/slony1_dump.sh script can be used against a subscriber -to get a snapshot of a replica's user data plus minimal status -information. - -If slon is started with -a , it will output an sql -script for every sync processing, containing statements that replicate -the changes plus keep the status information up to date. Note that these -scripts will have the same "grouping" of SYNC events that the replica -used. - -Next steps: - Add output of archive files by slon for subscribing, unsubscribing - and merging of sets and for ddl script executions. - -Jan - -================================= - -2005-02-17 cbbrowne doc/adminguide/slon.sgml,src/slon/remote_worker.c,src/slon/slon.c,src/slon/slon.h -1. Added DocBook documentation for "-a" slon option that writes log shipping - files - -2. Added docs for "-a" option to slon runtime - -3. Added SLON_MAX_PATH #define - -4. Macro for TERMINATE_QUERY_AND_ARCHIVE; (This one may be dubious.) - -================================= - -2005-02-18 cbbrowne doc/adminguide/plainpaths.sgml -Docs on setting up STORE PATH entries versus ADMIN CONNINFO - -================================= - -2005-02-18 cbbrowne doc/adminguide/adminscripts.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/prerequisites.sgml,doc/adminguide/reshape.sgml - - Add links into the table documentation... - - - Adding in info on path handling... - -================================= - -2005-02-18 darcyb Makefile.global.in,aclocal.m4,config.h.in,configure,configure.ac,config/acx_libpq.m4,config/acx_netsnmp.m4,config/acx_pthread.m4,config/acx_slonytools.m4,src/slon/Makefile,src/slon/confoptions.h,src/slon/misc.c,src/slon/misc.h,src/slon/slon.c,src/slon/slon.h,src/slon/snmp_thread.c -Check in first round of minimal net-snmp sub-agentx support, net-snmp 5.1.x is the minimum supported version. At the moment all you can do via SNMP is get/set the log level. SNMP support is not enabled or compiled in by default. Run configure with --with-netsnmp to enable support. - -Also added support for --with-perltools=. This is where the altperl tools should be installed to, if is not supplied the default install target is $PREFIX/bin. -TODO: configure needs to have proper detection of required perl modules (DBD:Pg) - -And finnaly, correct a compiler warning in confoptions.h - -================================= - -2005-02-18 cbbrowne doc/adminguide/faq.sgml -Added an example of "Event Surgery" to the FAQ. - -================================= - -2005-02-18 cbbrowne doc/adminguide/addthings.sgml,doc/adminguide/adminscripts.sgml,doc/adminguide/concepts.sgml,doc/adminguide/ddlchanges.sgml,doc/adminguide/defineset.sgml,doc/adminguide/dropthings.sgml,doc/adminguide/failover.sgml,doc/adminguide/faq.sgml,doc/adminguide/firstdb.sgml,doc/adminguide/intro.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/plainpaths.sgml,doc/adminguide/prerequisites.sgml,doc/adminguide/reshape.sgml,doc/adminguide/schemadoc.xml,doc/adminguide/slon.sgml,doc/adminguide/slonik.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/startslons.sgml,doc/adminguide/subscribenodes.sgml,doc/adminguide/usingslonik.sgml,doc/adminguide/versionupgrade.sgml -Eliminated most tags in favor of (much simpler!) - -Added a number of links into the schema docs - -================================= - -2005-02-18 darcyb src/slon/remote_worker.c -replace missing ; to allow remote_worke.c to compile again. - -================================= - -2005-02-20 smsimms tools/altperl/create_set.pl,tools/altperl/slon-tools.pm,tools/altperl/slon_tools.conf-sample -Added support for multiple sets in slon_tools.conf. - -Modified create_set.pl to accept a set ID or name (as given in -slon_tools.conf). I put the (unfortunately-named) get_set function in -slon-tools.pm so that it can be used by other set-manipulating -scripts. - -Also added --config and --help flags to create_set.pl, as I've been -doing with the other scripts. - -================================= - -2005-02-20 smsimms tools/altperl/Makefile,tools/altperl/slon_start.pl -Make use of the --with-perltools configure option. If it's specified, -install all of the Perl scripts to the specified location ($prefix/bin -by default). - -================================= - -2005-02-21 cbbrowne doc/adminguide/filelist.sgml -Fix typo in filelist.sgml - missing quote - -================================= - -2005-02-21 cbbrowne doc/adminguide/logshipping.sgml -Add in preliminary document on log shipping - -================================= - -2005-02-21 cbbrowne doc/adminguide/faq.sgml -Fix typo - spurious "<" - -================================= - -2005-02-21 cbbrowne doc/adminguide/filelist.sgml,doc/adminguide/slony.sgml -Add references to log shipping doc in - -================================= - -2005-02-21 cbbrowne doc/adminguide/logshipping.sgml -Added further notes as to what aspects of log shipping are limited at -this point - -================================= - -2005-02-22 smsimms tools/altperl/Makefile,tools/altperl/slon_watchdog.pl -Fixed the restart_node call in slon_watchdog.pl. - -Required adding a pgbindir subsitution to the Makefile, so that the -restart_node command can be run instead of just printed. - -================================= - -2005-02-22 smsimms tools/test_slony_replication.pl -Removed a site-specific "where" clause, pointed out by mastermind on IRC. - -================================= - -2005-02-22 smsimms tools/altperl/drop_node.pl,tools/altperl/failover.pl,tools/altperl/move_set.pl,tools/altperl/restart_node.pl,tools/altperl/restart_nodes.pl,tools/altperl/show_configuration.pl,tools/altperl/slon_pushsql.pl,tools/altperl/unsubscribe_set.pl,tools/altperl/update_nodes.pl -Removed the "set#" argument from failover.pl since it doesn't use it. - -Added --config and --help options to nearly all of the remaining -scripts that didn't have them. - -Combined restart_nodes.pl and restart_node.pl by adding an "--all" -switch to restart_node.pl and allowing it to accept multiple -nodes as arguments. - -Added a "does file exist" check to slon_pushsql.pl. - -Removed a few unused declarations and made some minor stylistic -changes. - -================================= - -2005-02-22 smsimms doc/adminguide/adminscripts.sgml,tools/altperl/Makefile,tools/altperl/README,tools/altperl/show_configuration.pl,tools/altperl/slon-tools.pm,tools/altperl/slon_tools.conf-sample,tools/altperl/slon_watchdog2.pl -Eliminated the need for $SLON_BIN_PATH by using @@PGBINDIR@@. - -================================= - -2005-02-22 xfade configure,config/acx_netsnmp.m4 -Check for real net-snmp headers instead of the wrapper headers. - -================================= - -2005-02-22 smsimms doc/adminguide/adminscripts.sgml,tools/altperl/execute_script.pl,tools/altperl/slon_pushsql.pl -Rename slon_pushsql.pl to execute_script.pl. The other scripts are -named after slonik commands, so this is more consistent. - -================================= - -2005-02-22 smsimms tools/altperl/create_set.pl,tools/altperl/drop_set.pl,tools/altperl/init_cluster.pl,tools/altperl/merge_sets.pl,tools/altperl/slon_kill.pl,tools/altperl/slon_start.pl,tools/altperl/slon_watchdog.pl,tools/altperl/subscribe_set.pl,tools/altperl/update_nodes.pl -Remove ".pl" from usage statement in files that still have it. - -================================= - -2005-02-22 darcyb doc/adminguide/adminscripts.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/reshape.sgml,doc/adminguide/startslons.sgml -Remove the .pl extentions on the admin scripts to reflect chnages as made previously - -================================= - -2005-02-23 cbbrowne doc/adminguide/defineset.sgml,doc/adminguide/dropthings.sgml,doc/adminguide/faq.sgml,doc/adminguide/intro.sgml,doc/adminguide/listenpaths.sgml,doc/adminguide/maintenance.sgml,doc/adminguide/monitoring.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/usingslonik.sgml -Changed all table references to be references to the DB schema -tables. - -================================= - -2005-02-23 smsimms tools/regenerate-listens.pl -Removed the @@PERL@@ substitution, which only works in altperl. -Instead, use the same line as slony_setup.pl. - -================================= - -2005-02-23 smsimms tools/altperl/create_set.pl,tools/altperl/drop_set.pl,tools/altperl/init_cluster.pl,tools/altperl/move_set.pl,tools/altperl/slon-tools.pm,tools/altperl/slon_tools.conf-sample,tools/altperl/subscribe_set.pl -Added support for sets originating on different nodes. The default -remains the $MASTERNODE, but you can now add an "origin" attribute in -the configuration file to designate that the set originates on some -other node. - -Removed the requirement that each node have a parent. This is now an -optional attribute in the configuration file -- otherwise, it is -assumed that the node can contact any other node that doesn't have a -parent, plus any node where it is the parent. - -Modified init_cluster.pl so that it only writes "store path" commands -for paths that exist. - -Fixed a couple of bugs in init_cluster.pl that were preventing it from -choosing the most efficient listen path between a given pair of nodes. - -================================= - -2005-02-24 cbbrowne doc/support/tested-arch.txt -Fixed typo, added more platforms - -================================= - -2005-02-24 cbbrowne doc/adminguide/usingslonik.sgml -More on the protocol of using Slony-I functions - -================================= - -2005-02-24 cbbrowne doc/adminguide/slonik_ref.sgml -Add references to the main stored functions used by each Slonik command - -================================= - -2005-02-25 cbbrowne src/slon/scheduler.c -Fix typo in comment - NO semantic change - -================================= - -2005-02-25 cbbrowne src/slon/remote_worker.c -Factored log shipping code that was integrated into the function sync_event() -into separate functions so that they may be used for other events as well. - -Further functional changes: - - - archive header contains comment lines to indicate where the "header" - ends and the 'body' of queries begins. That will be useful for splitting - the logs apart so that you test-apply the header (to see if it's valid) - before then applying the Whole Log. Blindly applying the Whole Thing - is a bad idea because it introduces a boatload of parsing work for any - log that is applied in inappropriate order. - - - more error checking has been introduced - - The "archive log" processing functions check return codes from - fprintf() and such, and if they encounter errors, this will abort - processing of the SYNC. - - There's still more to do in this regard; close_log_archive() does not - yet check rcs... - -================================= - -2005-02-25 cbbrowne doc/adminguide/logshipping.sgml -Added additional comments about usage of log shipping - -================================= - -2005-02-25 cbbrowne src/slon/remote_worker.c -Add log shipping support to the DDL_SCRIPT event - -================================= - -2005-02-25 cbbrowne doc/adminguide/logshipping.sgml -The DDL_SCRIPT event is supported, with the result that log shipping -now _does_ cope with Slonik "execute script" requests. - -================================= - -2005-02-27 cbbrowne tools/check_slon.sh,tools/check_slony_cluster.sh -Add in John Sidney-Woollett 's Nagios scripts -for checking that Slony-I is running properly. - -================================= - -2005-02-27 cbbrowne tools/README.checks -Docs for John Sidney-Woollett's Nagios scripts - -================================= - -2005-02-28 cbbrowne doc/adminguide/faq.sgml,doc/adminguide/help.sgml -Have link to pgpool in FAQ - -Add link to Freshmeat entry about Slony-I - -================================= - -2005-03-01 cbbrowne doc/adminguide/slonik_ref.sgml -Added in UPDATE FUNCTION; for some reason that hadn't made it into the -SGML documentation. - -================================= - -2005-03-03 cbbrowne tools/check_slony_cluster.sh -- Added in ability to query a remote host -- Mention the need to set PGPORT -- Needed to properly quote the cluster namespace -- psql often doesn't live in /usr/local/pgsql/bin; assume it to be in PATH - -================================= - -2005-03-03 cbbrowne tools/check_slon.sh -Portability changes: - -1. Use the appropriate ps command and options - - Script is aware of Linux, FreeBSD, Solaris, and AIX - -2. Fixed problem with line endings (that I probably introduced) - -================================= - -2005-03-07 cbbrowne src/backend/slony1_funcs.sql,src/ducttape/test_8_logship,src/slon/cleanup_thread.c,src/slon/remote_worker.c,src/slon/slon.h -Major changes to log shipping, allowing it to support substantially -all events (to the degree supportible). Notably, COPY_SET now -copies the contents of tables in newly subscribed sets. - -Also includes a new event, ACCEPT_SET, which addresses a race condition -where updates might be lost. If ACCEPT_SET is received before the -MOVE_SET has been processed, then the slon will wait until it has -received both. - -================================= - -2005-03-07 cbbrowne doc/adminguide/failover.sgml,doc/adminguide/help.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/usingslonik.sgml,src/ducttape/test_7_defines,src/slonik/scan.l -Added scanner support for include and define - -Flex scanner code as per Korry - -cbbrowne added a ducttape script to test this facility as well as -documentation. Due to the addition of this facility, the documentation -describing the use of M4 for similar purpose has been dropped. - -================================= - -2005-03-07 cbbrowne src/slon/confoptions.h -There's a minor typo in src/slon/confoptions.h that confuses -Syslog_ident and Syslog_facility - this patch should correct it. - - -- Korry - korryd@hotmail.com - -================================= - -2005-03-08 darcyb doc/adminguide/slonconf.sgml,share/slon.conf-sample,src/slon/conf-file.l,src/slon/confoptions.h,src/slon/dbutils.c,src/slon/slon.h -Add new conf option: sql_on_connection. -Description: - Execute the enclosed SQL on each node serviced by this slon daemon at - connect time it is usefull for setting ogging levels, or to tune the planner/memory memory used by slon. - -================================= - -2005-03-10 smsimms tools/altperl/ToDo -Removed the generate_listen_paths item and discussion, since it has -been implemented. - -Added the following: - -- The scripts are currently not compatible with "use strict". They - would probably become easier to follow if they were (particularly - with regard to figuring out where variables are defined). - -- We probably don't need one script per slonik command. Which of - these can be combined, preferably without having to implement pages - of arcane command-line options. - -- slon_start, slon_kill, and possibly slon_watchdog should be made - into a slon_ctl shell script, with an /etc/init.d-compatible - wrapper. - -================================= - -2005-03-10 smsimms tools/altperl/slon_tools.conf-sample -Removed a "my" keyword that limits the scope of Slony sets too much. - -================================= - -2005-03-10 smsimms tools/altperl/README -Rewrote the README file to reflect changes since 1.0.5. - -================================= - -2005-03-10 smsimms doc/adminguide/adminscripts.sgml -Document the existence of store_node.pl. - -================================= - -2005-03-10 cbbrowne doc/adminguide/monitoring.sgml,tools/test_slony_state.pl -Modified monitoring script so that it looks for some particular -problem values, and sends out email based on finding problems. - -================================= - -2005-03-10 cbbrowne src/slon/cleanup_thread.c,src/slon/local_listen.c,src/slon/runtime_config.c,src/slon/scheduler.c,src/slon/slon.c,src/slon/slon.h - -signal handling watchdog using forked processes - Frank Thompson - - -Slony-I 1.1 Change Request: - -The problem at hand is related to signal handling differences -in multithreaded programs between different operating -systems. In the slon process, it is intended that only the -"main" thread is dealing with signals and that it uses the -regular thread communication like mutexes and condition -variables to control all the other working threads. - -That mutex and condition var communication sometimes can lock -up, which causes the entire slon daemon to freeze. This can in -extreme cases even happen after one of the working threads -sent the main thread a signal to restart the slon process. - -What I had in mind to fix this is to have the program to -actually fork() very early on. The parent process will then be -the only one dealing with signals, while the childs ignores -all signals entirely. The parent and the master thread of the -child (which is the current slon) will communicate over a pipe -or a socketpair. This way, the parent could detect that the -slon stopped responding altogether and can issue a signal 9 to -cleanup the situation. - -In other words, building a watchdog process right into the -slon executable. - - -Summary of Changes: - - slon main() will now fork() at the start and allow the parent - process to handle cleanup, signal and termination of the child - process. The child process is the scheduler which will talk - to the parent (watchdog) process and vice versa via two sets - of socket pairs. When shutting down the child process in the - case of restart or termination, non blocking reads and writes - are used to avoid lockups. Failure to shutdown the scheduler - process nicely, the parent will SIGKILL it to ensure timely - operation within the signal handler. - - - - globals: - - slon.c - ------ - int watchdog_pipe[2]; // socket pair to talk with child process - int sched_wakeuppipe[2]; // socket pair to talk with scheduler and parent process - - runtime_config.c - ---------------- - pid_t slon_pid; // current pid - pid_t slon_ppid; // parent pid - pid_t slon_cpid; // child pid - - macros: - - slon_abort() and slon_restart() will now observe which process - in the tree they will act upon, parent or child - - #define slon_abort() - do { - kill((slon_ppid == 0 ? slon_pid : slon_ppid), SIGTERM); - pthread_exit(NULL); - } while (0) - #define slon_restart() - do { - kill((slon_ppid == 0 ? slon_pid : slon_ppid), SIGHUP); - } while (0) - - functions: - - slon.c - ------ - static void sighandler(int signo); // new slon parent process signal handler - static void main_sigalrmhandler(int signo); // new scheduler alarm signal handler - static void slon_kill_child(void); // new pipe notify based child termination function - -================================= - -2005-03-10 smsimms tools/altperl/store_node.pl -New script to add a node to an existing cluster. - -Based on init_cluster.pl, minus the "INIT CLUSTER" command, and only -adding paths and listens for the relevant node. - -================================= - -2005-03-11 cbbrowne Win32/Makefile.backend,Win32/Makefile.xxid,Win32/README,Win32/README.compiling -Add in some preliminary Win32 support; makefiles that may be helpful -for compiling xxid and backend functions. - -================================= - -2005-03-11 cbbrowne tools/altperl/slon-tools.pm -Bug #1152 - -Description: - - The query_slony_status function doesn't work with uppercase - setnames (the watchdog2 script uses that function). - workaround is to use \\"_$SETNAME\\" instead of _$SETNAME in the - script, and to use my $result=`$SLON_BIN_PATH/psql -p $port -h - $host -U slony --tuples-only $dbname --command="$query"`; - as the query command (the username was missing there). - -================================= - -2005-03-11 cbbrowne tools/altperl/slon-tools.pm -Per Bug #1152, add -U $dbuser parameter to database query - -================================= - -2005-03-11 smsimms tools/altperl/uninstall_nodes.pl -Added --config and --help to uninstall_nodes.pl (last script). - -According to the documentation for UNINSTALL NODE, it already handles -the various commands that were subsequently being sent to psql, so -I've removed them from this script. - -Instead of just running UNINSTALL NODE on $MASTERNODE, run it on all -nodes, doing $MASTERNODE last. - -================================= - -2005-03-14 cbbrowne src/slon/cleanup_thread.c -Changes to address problems found when running multiple Slony-I -clusters against a single backend... - -The problem is that if two slons are invoked at almost exactly the same -time, then the cleanup threads will be pretty nearly in phase with one -another. Which gives a (regrettably) excellent chance that both will try -doing an ANALYZE of pg_catalog.pg_listeners concurrently. They'll both -try to commit statistics for it, and one slon will therefore fail. - -1. At startup time, a random "bias" is calculated, and the slon - sleeps up to an extra 100000ms (e.g. - 100s) between iterations - -2. A further "fuzz" of up to 100s is added - -3. The 7 tables are vacuumed in 7 separate queries - -4. If any of the vacuums fails, this is treated as a SLON_ERROR, not - as a SLON_FATAL problem requiring that the slon fall over. - -================================= - -2005-03-15 cbbrowne src/ducttape/test_1_pgbench,src/ducttape/test_1_pgbench_no_node1,src/ducttape/test_2_pgbench,src/ducttape/test_3_pgbench,src/ducttape/test_4_pgbench,src/ducttape/test_5_pgbench,src/ducttape/test_7_defines -Fix a bunch of misspellings - -================================= - -2005-03-15 cbbrowne tools/test_slony_state.pl -Need to properly quote cluster name, as reported by Thomas Pundt... - -================================= - -2005-03-15 cbbrowne doc/adminguide/slon.sgml,doc/adminguide/slonik.sgml,doc/adminguide/slonik_ref.sgml,doc/adminguide/slony.sgml -Added link to slonconf.sgml, and make sure that new documentation -is included - -================================= - -2005-03-15 cbbrowne tools/test_slony_state-dbi.pl -Add a DBI-based state tester - -================================= - -2005-03-15 cbbrowne doc/adminguide/plainpaths.sgml -Discussion of added diagram - -================================= - -2005-03-15 cbbrowne doc/adminguide/complexenv.dia,doc/adminguide/complexenv.png -Added a network diagram for discussion purposes - -================================= - -2005-03-15 cbbrowne tools/test_slony_replication.pl -Cluster names need to be quoted in case they are in caps. - -================================= - -2005-03-15 cbbrowne src/ducttape/test_1_pgbench,src/ducttape/test_1_pgbench_no_node1,src/ducttape/test_2_pgbench,src/ducttape/test_3_pgbench,src/ducttape/test_4_pgbench,src/ducttape/test_5_pgbench,src/ducttape/test_6_autolisten,src/ducttape/test_7_defines,src/ducttape/test_8_logship -Fix widespread problem with checking Make version; needed to -quote $CGNU because it typically contains a multiword result. - -================================= - -2005-03-16 cbbrowne src/slon/remote_worker.c -Change the SUBSCRIBE_SET event so that it starts by checking for -the availability of tables on the subscriber node, and subscribes -sequences _BEFORE_ copying all the data. - -That way we find problems before doing 8h of copying of data... - -As suggested by Hannu Krosing - -================================= - -2005-03-16 smsimms tools/altperl/slon_watchdog.pl -Vary the sleep_seconds by up to 50% in either direction. This will -help prevent watchdog processes from all firing at the same time. - -================================= - -2005-03-16 cbbrowne debian/changelog,debian/compat,debian/control,debian/copyright,debian/dirs,debian/docs,debian/files,debian/rules,debian/slony1.substvars -Add Debian packaging control files, contributed by Tim Goodaire - - -================================= - -2005-03-16 smsimms tools/altperl/execute_script.pl -Added a "-c" to execute_script.pl, a la psql. If you only want to run -a small number of commands, this saves you the trouble of putting them -into a file first. - -Removed the "node#" argument since this is derivable. Replaced it -with a --node option so that it can be overridden if necessary. - -Added an error check to make sure the set exists in the configuration -file. - -================================= - -2005-03-16 smsimms tools/altperl/slon_kill.pl -Add an option to only kill watchdogs, not slons. - -Some mild reformatting as well. - -================================= - -2005-03-17 darcyb aclocal.m4,config.h.in,configure,configure.ac,config/libc.m4,src/slon/slon.c -Update sigaction flags to conform to POSIX standard. Add configure test to ensure we have SA_NODEFER as a sigaction flag. - -================================= - -2005-03-17 cbbrowne src/slon/cleanup_thread.c -cleanup thread uses Slony-I stored procedure getMinXid() instead of -trying to draw it out of pg_locks, eliminating the need to compare -values. - -================================= - -2005-03-18 xfade src/slon/misc.h,src/slon/snmp_thread.c -Change slon/misc.h and slon/snmp_thread.c to include c.h in the same manner as slon.c does. This fixes compiling when the includedir is not the parent dir of includedir-server. - -================================= - -2005-03-18 smsimms tools/altperl/slon-tools.pm -Backwards-compatibility fix: allow set# to be passed as setd+ in -addition to d+. - -I accidentally broke this while adding setname support. - -================================= - -2005-03-21 cbbrowne src/ducttape/test_1_pgbench,src/ducttape/test_2_pgbench,src/ducttape/test_3_pgbench,src/ducttape/test_4_pgbench,src/ducttape/test_5_pgbench,src/ducttape/test_6_autolisten,src/ducttape/test_7_defines,src/ducttape/test_8_logship -Fixed problem with evaluation of whether to use "make" or "gmake"; -running this on AIX showed off that the output of "which gmake" -can be an enormous string as opposed to the shell returning -bad return codes... - -================================= - -2005-03-22 smsimms tools/check_slony_cluster.sh -Patch from Vivek Khera: - -This patch de-bash-ifies the script, so it runs on /bin/sh under -freebsd. it still runs under bash, of course... - -================================= - -2005-03-23 darcyb src/slon/scheduler.c,src/slon/slon.c -From Andreas Pflug : - -In schedule.c and slon.c, pthread_self() result is compared with a -pthread_t variable, which isn't the recommended way to check for -equality; instead pthread_equal should be used. Under win32 this fails, -because pthread_t isn't a simple value. The attached file provides a -patch for this, and should make this portable for all pthread_t platforms. - -================================= - -2005-03-23 cbbrowne doc/adminguide/Makefile,doc/adminguide/README,doc/adminguide/logshipping.sgml,doc/adminguide/slon.sgml -Fixed makefile to build HTML output if you just type 'make' - -Updates to log shipping documentation - -Fixes to slon documentation, including adding in the names of internal -variables that are controlled by the slon command line parameters - -================================= - -2005-03-23 darcyb Makefile.global.in,configure,configure.ac,config/docs.m4,config/libc.m4,doc/Makefile,doc/adminguide/Makefile,doc/adminguide/bookindex.sgml,doc/concept/Makefile,doc/howto/Makefile,doc/implementation/Makefile,makefiles/Makefile.win,src/slon/slon.c -Whole raft of changes. -A) use signal() on win32 since there is no sigaction under that platform -B) have make install now install documentation if --with-docdir= is defined, This will have to be updated to have docs installed by default. - -================================= - -2005-03-25 xfade tools/altperl/Makefile -Fix make clean. Added -f to the rm statements. This prevents an error from being raised if a file is not there. - -================================= - -2005-03-25 xfade src/slon/slon.c -Fix cywin macro. - -================================= - -2005-03-25 xfade config/acx_pthread.m4,makefiles/Makefile.win,src/slon/Makefile -Fix cygwin build. Added a cygwin case to the phread macro. Added the CPPFLAGS to the Makefile.win. Override the CFLAGS in slon/Makefile to ensure that config.h can be found. - -================================= - -2005-03-29 cbbrowne src/slon/confoptions.h -Two changes to options: - -1. Maximum SYNC grouping changed to 10000 - -Rod Taylor reports a need for Big Grouping for cases where replication -falls WAY behind after copying Very Large replication sets. Query plans -can 'head pathological' such that things revert to Seq Scans, and if -you're doing a huge Seq Scan, you might as well process a bunch of groups -in view of the up-front cost of the Seq Scan - -2. Maximum desired_sync_time increased to 6000000 - -To support the above, potentially... - -================================= - -2005-03-29 cbbrowne src/slon/remote_worker.c -If desired sync time is zero, then eliminate evaluation of the -"desired sync time" logic. - -================================= - -2005-03-29 cbbrowne src/slon/cleanup_thread.c -Changes to cleanup thread - -1. Vacuum pg_statistic - -2. Change calculation of random biases (e.g. - vac_bias and the - per-iteration random value) to be proportional to SLON_CLEANUP_SLEEP. - That way, if one modifies SLON_CLEANUP_SLEEP, the random adjustments - will neither dominate nor disappear. - -3. Change log message to describe the _real_ error - being unable to - process the getMinXid() query. (It was referring to the old - approach where it was looking at pg_locks.) - -================================= - -2005-03-30 cbbrowne doc/adminguide/help.sgml -Add a link to a Russian HOWTO document for Slony-I. - -================================= - -2005-03-30 xfade src/backend/slony1_funcs.c -First step of implementing slon_quote_ident. This adds code taken from PostgreSQL -HEAD. Our function now quotes all identifiers known by your version of PostgreSQL. - -================================= - -2005-04-02 xfade config/libc.m4 -Add test to keep mingw from halting with an error. - -================================= - -2005-04-06 darcyb configure,configure.ac -Mark snmp support as experimental, which it is currently. - -================================= - -2005-04-06 darcyb src/backend/slony1_funcs.v74.sql -Since as of 7.4 truncate is transaction safe, lets use it in an effort to help performance along during a aborted subscribe. - -================================= - -2005-04-11 cbbrowne src/ducttape/test_9_fileconf -Add a test where configuration for slons is passed in via configuration -files rather than as command line parameters - -================================= - -2005-04-11 cbbrowne src/ducttape/test_1_pgbench -Make options consistent with other scripts - -================================= - -2005-04-11 cbbrowne src/slon/confoptions.h -Fix typos - -================================= - -2005-04-11 cbbrowne doc/adminguide/logshipping.sgml,doc/adminguide/slon.sgml,doc/adminguide/slonconf.sgml -More docs for log shipping and on the slon options - -================================= - -2005-04-11 xfade src/backend/slony1_funcs.sql -This patch adds two new functions: - -- slon_quote_brute is used in internal functions to add quotes around -identifiers. It replaces all calls to quote_ident in all our functions. This -way we quote every identifier, instead of just the reserved ones. - -Pro: we catch every problem with names in Caps and reserved words. -Con: This will increase the size of a row in sl_log_1, as everything is -quoted. - -- slon_quote_input is used in internal functions to make sure that user input -is quoted properly. - -Known issues: -Indexes with problematic names are not supported yet! - - -This patch touches a lot of functions, so please test this while we are still -in beta! - -================================= - diff --git a/RELEASE-2.0 b/RELEASE-2.0 deleted file mode 100644 index 7bf9e29f..00000000 --- a/RELEASE-2.0 +++ /dev/null @@ -1,229 +0,0 @@ - - -Differences from 1.2 stream - -- Removal of TABLE ADD KEY - -- It drops all support for databases prior to Postgres version 8.3. - -This is required because we now make use of new functionality in -Postgres, namely the trigger and rule support for session replication -role. As of now, every node (origin/subscriber/mixed) can be dumped with -pg_dump and result in a consistent snapshot of the database. - -- Still need alterTableRestore() for the upgrade from 1.2.x to 2.0. -upgradeSchema() will restore the system catalog to a consistent -state and define+configure the new versions of the log and deny_access -triggers. - -- Fix EXECUTE SCRIPT so that it records the ev_seqno for WAIT FOR EVENT -and make sure all DDL is executed in session_replication_role "local" -on the origin as well as all subscribers. This will cause the slony -triggers to ignore all DML statements while user triggers follow the -regular configuration options for ENABLE [REPLICA/ALWAYS] or DISABLE. - -- Let the logshipping files also switch to session_replication_role = -"replica" or "local" (for DDL). - -- Sequence tracking becomes enormously less expensive; rather than -polling *ALL* sequence values for each and every SYNC, the slon -stores the last value, and only records entries in sl_seqlog when -the value changes from that last value. If most sequences are -relatively inactive, they won't require entries in sl_seqlog very -often. - -- Change to tools/slony1_dump.sh (used to generate log shipping dump); - change quoting of "\\\backslashes\\\" to get rid of warning - -- Cleanup thread revised to push most of the logic to evaluate which - tables are to be vacuumed into a pair of stored functions. - - This fairly massively simplifies the C code. - -- Revised logging levels so that most of the interesting messages are - spit out at SLON_CONFIG and SLON_INFO levels. This can allow users - to drop out the higher DEBUG levels and still have useful logs. - -- Changed log selection query to be less affected by long running - transaction. This should help, in particular, the scenario where - it takes a very long time to subscribe to a set. In that situation, - we have had the problem where applying the later SYNCs gets - extremely costly as the query selecting logs wound up forced into a - Seq Scan rather than an index scan. - -- Removed all support for STORE/DROP TRIGGER commands. Users - should use the ALTER TABLE [ENABLE|DISABLE] TRIGGER functionality - available directly in Postgres from now on. - -- Improve Wiki page generation script so that it has an option to add in - a set of [[Category:Foo]] tags to allow automated categorization. - -- Documented how to fix tables that presently use Slony-I-generated - primary key candidates generated by TABLE ADD KEY - -- Add some specific timestamps during the 2007 "DST rule change - ambiguous time" (e.g. - during the period which, under former rules, - was not DST, but which now is, due to the recent rule change). - - Bill Moran ran into some problems with such dates; varying - PostgreSQL versions returned somewhat varying results. This wasn't - a Slony-I problem; the data was indeed being replicated correctly. - -- Made configure a bit smarter about automatically locating - docbook2man-spec.pl on Debian, Fedora, BSD. - -- Tests now generate |pipe|delimited|output| indicating a number of - attributes of each test, including system/platform information, - versions, and whether or not the test succeeded or failed. - -- Revised functions that generate listen paths - -- tools/configure-replication.sh script permits specifying a - destination path for generated config files. This enables using - it within automated processes, and makes it possible to use it to - generate Slonik scripts for tests in the "test bed," which has - the further merit of making tools/configure-replication.sh a - regularly-regression-tested tool. - -- Fix to bug #15 - where long cluster name (>40 chars) leads to - things breaking when an index name is created that contains - the cluster name. - - -> Warn upon creating a long cluster name. - -> Give a useful exception that explains the cause rather - than merely watching index creation fail. - - http://www.slony.info/bugzilla/show_bug.cgi?id=15 - -- Fix for bug #19 - added a script to help the administrator - search for any triggers on the database that is the source for - a schema that is to be used to initialize a log shipping node. - - The problem is that some/most/sometimes all triggers and rules - are likely to need to be dropped from the log shipping node lest - they interfere with replication. - -- Elimination of custom "xxid" functions - - PostgreSQL 8.3 introduces a set of "txid" functions and a - "txid_snapshot" type, which eliminates the need for Slony-I to have - its own C functions for doing XID comparisons. - - Note that this affects the structure of sl_event, and leads to some - changes in the coding of the regression tests. - - This eliminates the src/xxid directory and contents - -- All of the interesting cleanup work is now done in the stored - function, cleanupEvent(interval, boolean). - - Interesting side-effect: You can now induce a cleanup manually, - which will be useful for testing. - -- cleanupEvent now has two parameters, passed in from slon config - parameters: - - interval - cleanup_interval (default '10 minutes') - - This controls how quickly old events are trimmed out. It used to - be a hard-coded value. - - Old events are trimmed out once the confirmations are aged by - (cleanup_interval). - - This then controls when the data in sl_log_1/sl_log_2 can be - dropped. - - Data in *those* tables is deleted when it is older than the - earliest XID still captured in sl_event. - - boolean - cleanup_deletelogs (default 'false') - - This controls whether or not we DELETE data from sl_log_1/sl_log_2 - - By default, we now NEVER delete data from the log tables; we - instead use TRUNCATE. - -- We now consider initiating a log switch every time cleanupEvent() - runs. - - If the call to logswitch_finish() indicates that there was no log - switch in progress, we initiate one. - - This means that log switches will be initiated almost as often as - possible. That's a policy well worth debating :-). - -- logswitch_finish() changes a fair bit... - - It uses the same logic as in cleanupEvent() to determine if there - are any *relevant* tuples left in sl_log_[whatever], rather than - (potentially) scanning the table to see if there are any undeleted - tuples left. - -- At slon startup time, it logs (at SLON_CONFIG level) all of the - parameter values. Per Bugzilla entry #21. - - http://www.slony.info/bugzilla/show_bug.cgi?id=21 - -- New slonik "CLONE PREPARE" and "CLONE FINISH" command to assist in - creating duplicate nodes based on taking a copy of some existing - subscriber node. - -- We no longer use LISTEN/NOTIFY for events and confirmations, which - eliminates the usage that has caused pg_listener bloat. We instead - poll against the event table. - -- Various instances where slonik would use a default node ID of 1 have - been changed to remove this. - - Slonik scripts may need to be changed to indicate an EVENT NODE (or - similar) after migration to v2.0 as a result. - - The slonik commands involved: - - - STORE NODE - EVENT NODE - - DROP NODE - EVENT NODE - - WAIT FOR EVENT - WAIT ON - - FAILOVER - BACKUP NODE - - EXECUTE SCRIPT - EVENT NODE - -- Fixed a problem where ACCEPT_SET would wait for the corresponding - MOVE_SET or FAILOVER_SET to arrive while holding an exclusive lock - on sl_config_lock, preventing the other remote worker to process - that event. - -- Bug #54 - quite a few Bash-isms in various scripts have been - addressed so as to make the shell scripts more portable. - -- Bug #18 - the function parameter for the logtrigger functions no - longer requires any trailing v's - - Add a test to "test1" to make sure this logic gets exercised. - -- Created "start_slon.sh", an rc.d-style script for starting, - stopping, and checking status of slon processes. - - Integrated this into the regression tests, replacing previous - logic for starting/stopping slons, so that this script can be - considered carefully tested - -- Bug #46 - incompatibility with PostgreSQL 8.4 addressed - -- Use dollar quoting in stored functions - -- Additional logging of the time spent running queries, broken out on - a by-database basis - -- Fixes to documentation of WAIT FOR EVENT - -- Fix to bug #63 - cleanup thread had an imperative SELECT that needed - to become part of an IF statement - -- Enhancement - bug #61 - logshipper process should rescan the queue - when it empties - -- Note about "duct tape" tests: There are many of these tests that - reside in src/ducttape that reference features removed in v2.0. - - We will eventually be replacing these with a more proper "test suite" - so we're not remedying all the ducttape tests. From bce67337a02adf5e76549a4938a3530c367893c6 Mon Sep 17 00:00:00 2001 From: Christopher Browne Date: Wed, 26 Oct 2011 12:30:38 -0400 Subject: [PATCH 5/7] Mark version 2.2.0 as this is to be a new version --- config.h.in | 4 ++-- config_msvc.h | 4 ++-- configure.ac | 2 +- src/backend/slony1_funcs.sql | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config.h.in b/config.h.in index 90980291..d40551bb 100644 --- a/config.h.in +++ b/config.h.in @@ -12,8 +12,8 @@ #ifndef SLONY_I_CONFIG_H #define SLONY_I_CONFIG_H -#define SLONY_I_VERSION_STRING "2.1.0" -#define SLONY_I_VERSION_STRING_DEC 2,1,0 +#define SLONY_I_VERSION_STRING "2.2.0" +#define SLONY_I_VERSION_STRING_DEC 2,2,0 #ifndef PG_VERSION_MAJOR #define PG_VERSION_MAJOR 0 diff --git a/config_msvc.h b/config_msvc.h index 96a66091..85f28b44 100644 --- a/config_msvc.h +++ b/config_msvc.h @@ -4,8 +4,8 @@ #include -#define SLONY_I_VERSION_STRING "2.1.0" -#define SLONY_I_VERSION_STRING_DEC 2,1,0 +#define SLONY_I_VERSION_STRING "2.2.0" +#define SLONY_I_VERSION_STRING_DEC 2,2,0 #if PG_VERSION_NUM >= 90000 #define HAVE_GETACTIVESNAPSHOT 1 #define HAVE_TYPCACHE 1 diff --git a/configure.ac b/configure.ac index 3af8eb51..8f304c7f 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ # ---------- m4_define([SLONREL_VERSION], esyscmd([echo "$Name: $" | \ sed -e 's/\:\ REL_//' -e 's/\$//g' -e 's/_/./g' -e 's/\./\_/3' \ - -e 's/\ //g' -e s/\:/`echo 2.1.0`/ | tr -d '\n'])) + -e 's/\ //g' -e s/\:/`echo 2.2.0`/ | tr -d '\n'])) m4_pattern_allow([^SLON_AC_]) diff --git a/src/backend/slony1_funcs.sql b/src/backend/slony1_funcs.sql index fd0a792d..390188d2 100644 --- a/src/backend/slony1_funcs.sql +++ b/src/backend/slony1_funcs.sql @@ -429,7 +429,7 @@ create or replace function @NAMESPACE@.slonyVersionMinor() returns int4 as $$ begin - return 1; + return 2; end; $$ language plpgsql; comment on function @NAMESPACE@.slonyVersionMinor () is From 7510458de09769f0874187c7448aff1c69e7ab53 Mon Sep 17 00:00:00 2001 From: Christopher Browne Date: Wed, 2 Nov 2011 14:35:11 -0400 Subject: [PATCH 6/7] Make addition of apply_trigger to sl_log_* idempotent so that we can reload functions --- src/backend/slony1_funcs.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/slony1_funcs.sql b/src/backend/slony1_funcs.sql index 390188d2..37ecad59 100644 --- a/src/backend/slony1_funcs.sql +++ b/src/backend/slony1_funcs.sql @@ -5986,11 +5986,13 @@ begin end; $$ language plpgsql; +drop trigger if exists apply_trigger on @NAMESPACE@.sl_log_1; create trigger apply_trigger before INSERT on @NAMESPACE@.sl_log_1 for each row execute procedure @NAMESPACE@.log_apply(); alter table @NAMESPACE@.sl_log_1 enable replica trigger apply_trigger; +drop trigger if exists apply_trigger on @NAMESPACE@.sl_log_2; create trigger apply_trigger before INSERT on @NAMESPACE@.sl_log_2 for each row execute procedure @NAMESPACE@.log_apply(); From 7037602afa12b1456c94e3c44dee76bf9d2a826b Mon Sep 17 00:00:00 2001 From: Christopher Browne Date: Wed, 2 Nov 2011 14:42:38 -0400 Subject: [PATCH 7/7] In Postgres 8.3, TEXTARRAYOID is not defined. Adding def'n in case it's missing. --- src/backend/slony1_funcs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/slony1_funcs.c b/src/backend/slony1_funcs.c index cad7b512..ac6c4c8b 100644 --- a/src/backend/slony1_funcs.c +++ b/src/backend/slony1_funcs.c @@ -1171,6 +1171,11 @@ getClusterStatus(Name cluster_name, int need_plan_mask) * prepare the plan for the curren sl_log_x insert query. * */ + +#ifndef TEXTARRAYOID +#define TEXTARRAYOID 1009 +#endif + int prepareLogPlan(Slony_I_ClusterStatus * cs, int log_status) {