slony1-engine.git
14 years agoFix autoconf warning about datarootdir
Steve Singer [Wed, 6 Jul 2011 20:36:02 +0000 (16:36 -0400)]
Fix autoconf warning about datarootdir
Patch from Peter Eisentraut

Conflicts:

RELEASE

14 years agoFixing various compiler warnings.
Steve Singer [Wed, 6 Jul 2011 20:30:41 +0000 (16:30 -0400)]
Fixing various compiler warnings.
(cherry picked from commit e1573932e33453358cfc242199b7a0af03130c57)

Conflicts:

src/slonik/slonik.c

14 years agoAdd a couple more HTML files to .gitignore
Christopher Browne [Wed, 6 Jul 2011 17:00:27 +0000 (13:00 -0400)]
Add a couple more HTML files to .gitignore

14 years agoBug #224 - misspelled PKEYEDTABLES in altperl script
Christopher Browne [Wed, 6 Jul 2011 16:26:48 +0000 (12:26 -0400)]
Bug #224 - misspelled PKEYEDTABLES in altperl script

14 years agoMerge branch 'master' of ssh://git.postgresql.org/slony1-engine
Christopher Browne [Wed, 6 Jul 2011 15:34:40 +0000 (11:34 -0400)]
Merge branch 'master' of ssh://git.postgresql.org/slony1-engine

Conflicts:
RELEASE

14 years agoRemove rules for building concept/implementation documentation
Christopher Browne [Wed, 6 Jul 2011 15:32:24 +0000 (11:32 -0400)]
Remove rules for building concept/implementation documentation

Instead, these documents are captured in 'compiled' form (pdf/ps/txt).

This means we no longer need dependency on groff

14 years agoReplacing spaces with tabs.
Steve Singer [Tue, 21 Jun 2011 17:42:05 +0000 (13:42 -0400)]
Replacing spaces with tabs.
Spaces break the makefile (at this point) tabs do not.

14 years agoFix for bug # 159.
Steve Singer [Tue, 21 Jun 2011 14:26:42 +0000 (10:26 -0400)]
Fix for bug # 159.

make distclean was deleting the flex/bison files in slony_logshipper.
These should be included in the tarfile.  They only should be deleted by
maintainer-clean.  However the maintainer-clean rule was invoking
clean on the subdirectories NOT maintainer-clean.
(cherry picked from commit bba22efd12bbcd61abbdcda4f264d175d8e103b2)

Conflicts:

src/parsestatements/Makefile

14 years agoRevise documentation to better describe the log trigger handling
Steve Singer [Thu, 16 Jun 2011 17:15:00 +0000 (13:15 -0400)]
Revise documentation to better describe the log trigger handling
by EXECUTE SCRIPT, and the appropriate procedures for manually
altering DDL.

Conflicts:

doc/adminguide/ddlchanges.sgml

14 years agoFix for bug 221.
Steve Singer [Wed, 15 Jun 2011 20:12:19 +0000 (16:12 -0400)]
Fix for bug 221.

A cast of: CREATE CAST ( int4 AS text ) WITH INOUT AS IMPLICIT;
was created on the users database.  This caused
'Could not choose a best candidate operator. ' errors.

Add in an explicit cast to the queries.

Report/Fix by TAKATSUKA Haruka (harukat@sraoss.co.jp)
(cherry picked from commit f46a9a4576b758be877ecc4da87aecdc156ebe8c)

14 years ago Fix for bug 217.
Steve Singer [Tue, 14 Jun 2011 14:04:37 +0000 (10:04 -0400)]
Fix for bug 217.

    This patch modifies execute script (ddlscript_complete_int) so that it will
    reconfigure the trigger arguments on the log trigger for any tables that need it.

    This version of the patch only reconfigures tables already locked by the SQL script,
    but the repair_log_triggers() function provides can be called with false to
    repair all tables.

14 years agoobtain a mutex before calling slon_init()
Steve Singer [Thu, 16 Jun 2011 17:10:27 +0000 (13:10 -0400)]
obtain a mutex before calling slon_init()

Otherwise the monitorThread and the localListener thread (or another thread)
can call into slon_init() at the same time.

Conflicts:

RELEASE

14 years agoFix for bug219.
Steve Singer [Thu, 16 Jun 2011 17:08:25 +0000 (13:08 -0400)]
Fix for bug219.
If the postgresql version is newer than 9.0 we should then use the 8.4 functions
not the 8.3 ones.

Conflicts:

RELEASE

14 years agoMerge branch 'master' of ssh://git.postgresql.org/slony1-engine
Christopher Browne [Wed, 15 Jun 2011 15:59:34 +0000 (11:59 -0400)]
Merge branch 'master' of ssh://git.postgresql.org/slony1-engine

Conflicts:
RELEASE

14 years agoSome editorial work on release notes
Christopher Browne [Wed, 15 Jun 2011 15:53:49 +0000 (11:53 -0400)]
Some editorial work on release notes

14 years agoFix for bug220.
Steve Singer [Fri, 10 Jun 2011 12:13:24 +0000 (08:13 -0400)]
Fix for bug220.
The parameters being passed to reshapeSubscription are in the wrong order.
Report/proposed fix from Glyn Astill <glynastill@yahoo.co.uk>

14 years agoAdd EnterpriseDB to the server version detection as requested
Jan Wieck [Thu, 9 Jun 2011 13:00:22 +0000 (09:00 -0400)]
Add EnterpriseDB to the server version detection as requested
by Mark Mielke.

14 years agoobtain a mutex before calling slon_init()
Steve Singer [Wed, 8 Jun 2011 20:46:00 +0000 (16:46 -0400)]
obtain a mutex before calling slon_init()

Otherwise the monitorThread and the localListener thread (or another thread)
can call into slon_init() at the same time.

14 years agoUpdating release notes
Steve Singer [Wed, 8 Jun 2011 20:39:38 +0000 (16:39 -0400)]
Updating release notes

14 years agoReverting part 2 of 7970189ec93faf3ee71cf49e97529980bbd219aa
Steve Singer [Wed, 1 Jun 2011 18:37:17 +0000 (14:37 -0400)]
Reverting part 2 of 7970189ec93faf3ee71cf49e97529980bbd219aa
This completes the revert of that commit.

Without the DELETE when you tried failing over to a non-direct
subscriber you could end up with a loop in sl_subscribe after
the failedNode function returns.

ie before failedNode() sl_subscribed showed

set,provider,receiver
1,1,2
1,1,3
1,3,4
1,4,5
and after
1,4,2
1,4,3
1,4,2
1,4,5

notice 4=>2 and 2=>4

14 years agoHave the regression tests specify the port
Steve Singer [Wed, 8 Jun 2011 20:01:46 +0000 (16:01 -0400)]
Have the regression tests specify the port

14 years agoFix for bug 218.
Steve Singer [Wed, 8 Jun 2011 17:12:29 +0000 (13:12 -0400)]
Fix for bug 218.
In serializable isolation level any table locks
should be taken out before the first SQL statement or
the effect won't be as expected.  Invoking storePath_int()
counts as a SQL statement, so we lock the table before.

14 years agoMerge branch 'master' of git://git.postgresql.org/git/slony1-engine
Christopher Browne [Tue, 31 May 2011 21:34:40 +0000 (17:34 -0400)]
Merge branch 'master' of git://git.postgresql.org/git/slony1-engine

14 years agoChanging the test to ensure a) wait for a sync before finishing
Steve Singer [Tue, 31 May 2011 15:06:33 +0000 (11:06 -0400)]
Changing the test to ensure a) wait for a sync before finishing
b) have an 'id' field for result comparision because the common
compare code expects it.

14 years agoAdding in testpkeychange regression test.
Steve Singer [Fri, 27 May 2011 19:24:39 +0000 (15:24 -0400)]
Adding in testpkeychange regression test.
This test alters the primary key of a replicated table via
EXECUTE SCRIPT.

Currently slony 2.1.0 is failing this test (it is expected that 2.0 will fail
as well)

14 years agoFixed memory corruption issue in slonik.
Steve Singer [Fri, 27 May 2011 19:06:01 +0000 (15:06 -0400)]
Fixed memory corruption issue in slonik.
If slonik tries to get the last event id from
a node that does not yet have slony installed it skips
over the element in the return array. This has the effect
of returning leaving that element uninitialized.
Instead set it to -1.

14 years agoAdd slonikconfdump.sh back in. This will need to go into 2.0, 2.1, master
Steve Singer [Fri, 27 May 2011 15:21:11 +0000 (11:21 -0400)]
Add slonikconfdump.sh back in.  This will need to go into 2.0, 2.1, master

14 years agoVarious Win32 fixes REL_2_1_0_B2
Steve Singer [Fri, 27 May 2011 14:23:31 +0000 (10:23 -0400)]
Various Win32 fixes
-Add resetSession to the win32 exports file.
-Also remove /DEBUG from the win32 slony1_funcs.dll link line
-Use PG_LIB not PGHOME.  Also include standard headers on win32
-Win32 makefile changes.  The location of required applications
 (postgresql,pthreads,gettext) will now come from the environment
 instead of requiring users to change the makefiles.

14 years agoChanging version for beta2
Steve Singer [Fri, 27 May 2011 12:30:25 +0000 (08:30 -0400)]
Changing version for beta2

14 years agoAdd test to regression test "test1" which tries to add a set of tables
Christopher Browne [Thu, 26 May 2011 22:48:05 +0000 (18:48 -0400)]
Add test to regression test "test1" which tries to add a set of tables
"en masse" using the bulk-add facility

14 years agoBug 208.
Steve Singer [Thu, 26 May 2011 20:52:26 +0000 (16:52 -0400)]
Bug 208.

    Fixing various issues with bulk adding of tables/sequences.

    - Make sure sl_event_lock is obtained before searching the
      schema for the table.
    - Uses the id value queried if none was provided in the command.
    - Fixing misplaced bracket in malloc() call.

14 years agoMerge branch 'master' of github.com:cbbrowne/slony1-engine
Christopher Browne [Thu, 19 May 2011 01:57:05 +0000 (21:57 -0400)]
Merge branch 'master' of github.com:cbbrowne/slony1-engine

14 years agoFixes to perltools for 2.1.0.
Steve Singer [Fri, 13 May 2011 18:31:43 +0000 (14:31 -0400)]
Fixes to perltools for 2.1.0.

2.1.0 does not allow certain commands (ones that might wait) to
be inside of a try block.  This patch modifies the perltools
to not produce slonik scripts with these commands in a try block.

14 years agoBug 210.
Steve Singer [Fri, 13 May 2011 13:57:24 +0000 (09:57 -0400)]
Bug 210.
Merge set should wait for both sets to be subscribed before merging.

14 years agoAdding BulkAdding test to the disorder test set.
Steve Singer [Thu, 12 May 2011 19:25:53 +0000 (15:25 -0400)]
Adding BulkAdding test to the disorder test set.
This test was part of the original bulk adding work
but did not get merged in due to merge issues.

14 years agoFix for bug 207.
Steve Singer [Thu, 12 May 2011 14:49:35 +0000 (10:49 -0400)]
Fix for bug 207.

    slony_is_installed() should not rollback when inside of a try
    block.  The transaction can be open and already have done
    actions that should not be rolledback.

    If the caughtup check fails then the return code
    should be propogated up.

    Also replacing constant used in array size(64) with
    a #define.

14 years agoMerge branch 'master' of git://git.postgresql.org/git/slony1-engine
Christopher Browne [Wed, 11 May 2011 17:05:33 +0000 (13:05 -0400)]
Merge branch 'master' of git://git.postgresql.org/git/slony1-engine

14 years agoFix for bug #208.
Steve Singer [Tue, 10 May 2011 21:22:12 +0000 (17:22 -0400)]
Fix for bug #208.
Pass the tab_id we get above to the stored
procedure.

14 years agoFlush stdout when printing 'waiting' messages to ensure
Steve Singer [Tue, 10 May 2011 15:50:31 +0000 (11:50 -0400)]
Flush stdout when printing 'waiting' messages to ensure
they get displayed right away.

14 years agoFixing Bugs #205,#206.
Steve Singer [Tue, 10 May 2011 15:48:47 +0000 (11:48 -0400)]
Fixing Bugs #205,#206.

       due to cloneNodePrepare having a  different return
       type

14 years ago commit d518992f797b6abf97665910fe4ff35d015d89d5 REL_2_1_0_B1
Steve Singer [Fri, 6 May 2011 20:20:41 +0000 (16:20 -0400)]
commit d518992f797b6abf97665910fe4ff35d015d89d5
    Author: Steve Singer <ssinger@ca.afilias.info>
    Date:   Fri May 6 16:15:36 2011 -0400

        Updating version for 2.1.0.b1

    commit ce9af28cb931b79df43e71c8557bf91a255dc613
    Author: Steve Singer <ssinger@ca.afilias.info>
    Date:   Fri May 6 15:44:09 2011 -0400

        Removing NODEFAULTLIB from the link line for visual studio.
        The builds from a clean source checkout don't link properly
        with this specified.

14 years agoAdditional documentation updates for Win32
Steve Singer [Fri, 6 May 2011 17:46:11 +0000 (13:46 -0400)]
Additional documentation updates for Win32

14 years agoWin32 related fixes.
Steve Singer [Fri, 6 May 2011 17:10:44 +0000 (13:10 -0400)]
Win32 related fixes.

-Replacing references to outdated win32 slony sites.
 EnterpriseDB is much more current with respect to building slony
 binaries than the other sites.
-Adding section on building win32.
-Misc cleanups related to the windows build

14 years agoRemoving postgresql server header and the associated
Steve Singer [Fri, 6 May 2011 17:09:23 +0000 (13:09 -0400)]
Removing postgresql server header and the associated
MAXALIGN macro.  Instead allocate the structures from
two different memory pools (to be futureproof'd to changes
to the structure)

14 years agoBug 204.
Steve Singer [Fri, 6 May 2011 16:07:10 +0000 (12:07 -0400)]
Bug 204.

The commit 7970189ec93faf3ee71cf49e97529980bbd219aa item (1) says
it removed a duplicate query. That query in fact is/was slightly
different than the one above and should not have been removed.

FAILOVER to a non direct subscriber leaves sl_subscribe with
entires listing the backup node as both a provider and a receiver
of the replication set. This commit should revert that regression.

14 years agoMerge branch 'master' of git://git.postgresql.org/git/slony1-engine
Christopher Browne [Wed, 4 May 2011 22:10:08 +0000 (18:10 -0400)]
Merge branch 'master' of git://git.postgresql.org/git/slony1-engine

14 years agoAdd some more ignorable files that get generated to .gitignore here and there
Christopher Browne [Wed, 4 May 2011 22:09:26 +0000 (18:09 -0400)]
Add some more ignorable files that get generated to .gitignore here and there

14 years agoMerge branch 'master' of git://git.postgresql.org/git/slony1-engine
Christopher Browne [Wed, 4 May 2011 22:07:02 +0000 (18:07 -0400)]
Merge branch 'master' of git://git.postgresql.org/git/slony1-engine

14 years agoGit can also ignore the latest HTML files
Christopher Browne [Wed, 4 May 2011 21:57:23 +0000 (17:57 -0400)]
Git can also ignore the latest HTML files

14 years agoMake sure that <sect1> elements have ID attributes associated, so
Christopher Browne [Wed, 4 May 2011 21:55:57 +0000 (17:55 -0400)]
Make sure that <sect1> elements have ID attributes associated, so
that HTML always generates predictable web page names, rather than
auto-generated (and unstable) stuff like x4934.html.

14 years agoMerge branch 'master' of git://git.postgresql.org/git/slony1-engine
Christopher Browne [Wed, 4 May 2011 16:17:41 +0000 (12:17 -0400)]
Merge branch 'master' of git://git.postgresql.org/git/slony1-engine

14 years agoThis was implicitly removed with commit 275a2eaddf995e3376b8fb42dad5c199a6a98bfc
Steve Singer [Wed, 4 May 2011 15:55:29 +0000 (11:55 -0400)]
This was implicitly removed with commit 275a2eaddf995e3376b8fb42dad5c199a6a98bfc

14 years agoUpdating release notes from recent commits
Steve Singer [Wed, 4 May 2011 15:45:27 +0000 (11:45 -0400)]
Updating release notes from recent commits

14 years agoVisual Studio Support + Bug #90.
Steve Singer [Wed, 4 May 2011 15:38:43 +0000 (11:38 -0400)]
Visual Studio Support + Bug #90.

 -Adding NMake (Visual Studio) makefiles for slon and slonik.

 -Removing postgres.h from slon. Instead we have copied relevant
  bits from the postgresql headers to types.h since these bits
  are more us re-using postgresql portability functions.
  Slon does not actually link in with the backend or need
  backend functionality.

  -Other changes to support Visual Studio builds of slony
  - Eliminate depenency on postgres.h

   Squash merge from 2.0 working branch to master/2.1

  - Fixes for Sun C compiler builds.
    These fixes allow slony to build with the SUN C compiler

14 years agoMake sl_event_lock locking work with try blocks.
Steve Singer [Wed, 4 May 2011 15:20:54 +0000 (11:20 -0400)]
Make sl_event_lock locking work with try blocks.

The LOCK sl_event_lock must be before any queries/SQL in the
transaction.  In a try lock where multiple slonik commands
are done as part of the same transaction this causes issues.
The solution to this is that if in a try block then obtain
sl_event_lock when a transaction on the dbconn is opened

14 years agoAutomatic Wait For.
Steve Singer [Wed, 4 May 2011 15:14:25 +0000 (11:14 -0400)]
Automatic Wait For.

This is a merge of the auto_wait_for feature branch.

This change modifies slonik so that it will (in normal circumstances)
automatically wait for events to be confirmed before proceeding in
cases where it detects that this is required.

See the documentation changes included in this patch for more details.

14 years agoProvide a way of resetting the per session datastructure
Steve Singer [Wed, 4 May 2011 15:04:10 +0000 (11:04 -0400)]
Provide a way of resetting the per session datastructure
that stores the cluster status in the C functions.

cloneFinish() changes the sequence sl_local_node_id but the value
is cached in the C functions per session.  If getLocalNodeId()
has already been called in the current session cloneNode will
do the wrong thing because subsequent calls to getLocalNodeId()
will return the old value.

With the auto-wait-for changes slonik typically calls
getLocalNodeId() before submitting commands this exposes
this bug.

Here we provide a C function that resets the cluster status
and have the cloneNode function call this after changing
the sl_local_node_id value.

14 years agoRemoving section on bare metal/direct slony function calls for configuration.
Steve Singer [Wed, 4 May 2011 13:15:16 +0000 (09:15 -0400)]
Removing section on bare metal/direct slony function calls for configuration.

The supported way of changing slony configuration is through slonik, period.
We have not maintained the stored functions as a stable API through releases
this means tools call these functions need to be release specific.
Slonik also does more than just calling a stored function, this is
particularly true with 2.1 and sl_event_lock.

14 years agoMerge branch 'master' of git://git.postgresql.org/git/slony1-engine
Christopher Browne [Tue, 3 May 2011 21:24:54 +0000 (17:24 -0400)]
Merge branch 'master' of git://git.postgresql.org/git/slony1-engine

14 years agoMore reorg of chapters.
Steve Singer [Tue, 3 May 2011 20:44:00 +0000 (16:44 -0400)]
More reorg of chapters.
This gets rid of the "Stuff left out" section and moves the content
to more approriate chapters (ie Additional Utilities).

A blurb about cleanupThread is deleted but this is covered
elsewhere in the documentation (ie the cleanupEvent function page)

14 years agoVaccuuming is covered in performance.sgml.
Steve Singer [Tue, 3 May 2011 18:41:11 +0000 (14:41 -0400)]
Vaccuuming is covered in performance.sgml.
Furthermore this discussion applies to older versions of slony
with pre 8.3 versions of postgresql. The current 2.1 recommendation
is to use autovacuum. If we don't like that we should update
performance.sgml

14 years agoRerog of some of the chapters
Steve Singer [Tue, 3 May 2011 18:33:16 +0000 (14:33 -0400)]
Rerog of some of the chapters

14 years agoUpdating installation guide for 2.1
Steve Singer [Tue, 3 May 2011 18:00:05 +0000 (14:00 -0400)]
Updating installation guide for 2.1

14 years agoMerge branch 'master' of ssh://git.postgresql.org/slony1-engine
Christopher Browne [Tue, 3 May 2011 18:52:05 +0000 (14:52 -0400)]
Merge branch 'master' of ssh://git.postgresql.org/slony1-engine

14 years agoSlonik scripts are only to return values in range 0..255
Christopher Browne [Tue, 3 May 2011 18:51:21 +0000 (14:51 -0400)]
Slonik scripts are only to return values in range 0..255
per commit ef8c0ab6d26510bd61a24718c0a763911043aec5

14 years agoMerge branch 'master' of git://git.postgresql.org/git/slony1-engine
Christopher Browne [Tue, 3 May 2011 15:20:50 +0000 (11:20 -0400)]
Merge branch 'master' of git://git.postgresql.org/git/slony1-engine

14 years agoMerge branch '21_docs'
Steve Singer [Tue, 3 May 2011 15:06:22 +0000 (11:06 -0400)]
Merge branch '21_docs'

14 years agoMerge branch 'master' of git://git.postgresql.org/git/slony1-engine
Christopher Browne [Mon, 2 May 2011 21:18:29 +0000 (17:18 -0400)]
Merge branch 'master' of git://git.postgresql.org/git/slony1-engine

14 years agoFix to DDL regression tests - some of the file paths were wrong.
Christopher Browne [Mon, 2 May 2011 21:17:23 +0000 (17:17 -0400)]
Fix to DDL regression tests - some of the file paths were wrong.

14 years agoRemove LOCK requests that are a new feature of bug #137
Christopher Browne [Mon, 2 May 2011 21:16:05 +0000 (17:16 -0400)]
Remove LOCK requests that are a new feature of bug #137

14 years agoFix paths to DDL scripts
Christopher Browne [Mon, 2 May 2011 20:59:15 +0000 (16:59 -0400)]
Fix paths to DDL scripts

14 years agoUpdating documentation for DDL Changes section.
Steve Singer [Mon, 2 May 2011 20:03:20 +0000 (16:03 -0400)]
Updating documentation for DDL Changes section.
Add in section talking about manually applying DDL.

14 years agoAdd release notes for bug #201
Christopher Browne [Fri, 29 Apr 2011 20:14:41 +0000 (16:14 -0400)]
Add release notes for bug #201

14 years agoMerge branch 'master' of ssh://git.postgresql.org/slony1-engine
Christopher Browne [Fri, 29 Apr 2011 20:12:07 +0000 (16:12 -0400)]
Merge branch 'master' of ssh://git.postgresql.org/slony1-engine

14 years agoMerge remote-tracking branch 'github/bug201'
Christopher Browne [Fri, 29 Apr 2011 20:11:35 +0000 (16:11 -0400)]
Merge remote-tracking branch 'github/bug201'

http://www.slony.info/bugzilla/show_bug.cgi?id=201

Allow command-line options to be configured from slon_tools.conf

14 years agoHave the environment variable point at the clustertest jar, not
Steve Singer [Fri, 29 Apr 2011 15:06:42 +0000 (15:06 +0000)]
Have the environment variable point at the clustertest jar, not
2 directories above it.

14 years agoRemoving test results.
Steve Singer [Thu, 28 Apr 2011 21:02:25 +0000 (17:02 -0400)]
Removing test results.
They should not be in git

14 years agoRemoving test result directories. This should not be in git
Steve Singer [Thu, 28 Apr 2011 20:52:14 +0000 (16:52 -0400)]
Removing test result directories. This should not be in git

14 years agoFixing bug introduced in a0729b759306dd21fe4043ee52a80fae5b515c90
Steve Singer [Tue, 26 Apr 2011 19:53:48 +0000 (15:53 -0400)]
Fixing bug introduced in a0729b759306dd21fe4043ee52a80fae5b515c90
query1 has a 'start transaction;' command that needs to be executed
otherwise no transaction is started.  This makes rolling back
on errors hard.

14 years agoCommits 9687c2a7c866102dab9bde388ce86e51d28f29df
Steve Singer [Mon, 25 Apr 2011 20:41:15 +0000 (16:41 -0400)]
Commits 9687c2a7c866102dab9bde388ce86e51d28f29df
5c009b6d97fccb2342874f6cf5e8d1e611470b12 both added the same line.
This should only be added once.
Removing the extra rtcfg_namespace line.

14 years agoSwitching ACCEPT SET messages to info.
Steve Singer [Wed, 9 Feb 2011 21:36:45 +0000 (16:36 -0500)]
Switching ACCEPT SET messages to info.
It is really useful to see when this event happens in the logs
(cherry picked from commit 5df057dc12fe1148a07fcd5a445992c453b87306)

14 years agoFixing an issues where slon would try to start a new transaction
Steve Singer [Mon, 25 Apr 2011 17:40:42 +0000 (13:40 -0400)]
Fixing an issues where slon would try to start a new transaction
and obtain sl_config_lock instead of calling enableSubscription.
This was causing a deadlock with sl_event_lock during some tests

14 years agoObtaining this lock actually increases deadlock because
Steve Singer [Tue, 19 Apr 2011 14:24:30 +0000 (10:24 -0400)]
Obtaining this lock actually increases deadlock because
it creates a conflict between sl_config_lock and sl_event_lock.

slonik initiated queries will always obtain sl_event_lock before
sl_config_lock (or at least when creating events).  Having
remote_worker do the opposite isn't a good idea.

If we find more examples of deadlock with this removed then
they need to be adressed in some other fashion.

14 years agoDo not lock sl_event when adding an event.
Steve Singer [Tue, 19 Apr 2011 14:23:35 +0000 (10:23 -0400)]
Do not lock sl_event when adding an event.
The caller should already have a lock on sl_event_lock
which must be obtained before the txid is assigned

14 years agoUpdated release notes for HEAD
Christopher Browne [Thu, 14 Apr 2011 18:43:37 +0000 (14:43 -0400)]
Updated release notes for HEAD
Reviewed Git logs going back to when we started work in mid-2010.
Note that there's a *tiny* bit of Emacs org-mode stuff that I have
put in so that we can easily autogenerate some nice looking docs
including well-formed HTML to put onto the web site.

14 years agoFixing a bug in the log table selection query.
Steve Singer [Mon, 11 Apr 2011 13:27:35 +0000 (09:27 -0400)]
Fixing a bug in the log table selection query.
It is possible for the code to enter the if block where
no sets come from that provider.  The code will still
execute provider_query so we need to make it a valid query
that returns no rows.

14 years agoBug #196 - snapshot id values appear to travel backwards in sl_event
Christopher Browne [Tue, 12 Apr 2011 20:20:06 +0000 (16:20 -0400)]
Bug #196 - snapshot id values appear to travel backwards in sl_event

Put in a lock on a new table, event_lock, whenever events are trying
to generate a SYNC event, and make sure this is the very first thing
executed, to prevent anything else from race-conditioning in to get the
SYNC first

Merge remote-tracking branch 'github/bug196'

Conflicts:
RELEASE
src/backend/slony1_funcs.sql

14 years agoFixing segfault.
Steve Singer [Tue, 12 Apr 2011 14:01:22 +0000 (10:01 -0400)]
Fixing segfault.
The clustername needs to be used for both teh first %s and the second %s

14 years agoFixing segfault.
Steve Singer [Tue, 12 Apr 2011 14:01:22 +0000 (10:01 -0400)]
Fixing segfault.
The clustername needs to be used for both teh first %s and the second %s

14 years agohttp://www.slony.info/bugzilla/show_bug.cgi?id=201
Jason Yan [Fri, 1 Apr 2011 17:05:21 +0000 (13:05 -0400)]
http://www.slony.info/bugzilla/show_bug.cgi?id=201

Allow command-line options to be configured from slon_tools.conf

14 years agoBug #175 - implement a monitoring thread, which stores information
Christopher Browne [Fri, 18 Mar 2011 19:09:12 +0000 (15:09 -0400)]
Bug #175 - implement a monitoring thread, which stores information
about the activities of the various slon threads in the new table
sl_components

Squashed commit of the following:

commit da552dd21c87301d7d6d6762a3894c841816d48d
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Mar 18 15:01:34 2011 -0400

    Close DB connection here, pointed out by Steven

commit 0003b57ee0fb6ba855c2aa9bcfbc174671996087
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Mar 18 12:20:37 2011 -0400

    Add docs about log entries that can occur relating to monitoring thread

commit d9b69c024d34a9b41a87876270d84d1c5b2b32a6
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Mar 18 12:13:17 2011 -0400

    Add log warning if the stack gets pretty big.

commit 24da0a137120f4032858230836b39ed14da755fb
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Mar 18 12:05:55 2011 -0400

    Memory leak observed by Steve

commit d51049b54f014ee4f00f974fc9629a7d64ca9727
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Mar 18 11:45:03 2011 -0400

    upgrade schema needs to create sl_components if it is missing

commit cd3519bba5a03ce2f577747324f4a9ebc697d317
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Mar 17 13:41:38 2011 -0400

    Add sl_components to the set of tables we should consider vacuuming

commit d3f66cccb54168ca8d6a80261337a66228720cd8
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Wed Mar 16 16:40:35 2011 -0400

    Add note about interpreting sl_components for monitoring thread

commit a61f4642ed29bc727d2361a4000500b81573ea11
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Wed Mar 16 16:40:08 2011 -0400

    When exiting the monitoring thread, shut off data collection.

    And if the monitoring thread is shut off, don't collect any data in the queue.

commit d1a5be153e51cd10ac12a3dcb9cbb63856a18306
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Wed Mar 16 16:31:47 2011 -0400

    Revising failures so that things that aren't honestly fatal do not
    restart the slon.

    Some error conditions now lead to the monitoring thread terminating without running.

    Actually, there's an "eek, there's a problem" here; if the monitoring
    thread isn't running, then nothing is there to empty entries from the queue.

    So if we're closing it off, then we should turn off entry collection.
    Turn the lights off before going home...

commit d00574d2d1793a372467bc103a7772030fd939ab
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Mar 15 13:05:25 2011 -0400

    Various changes resulting from Steve Singer's review:

    1.  INITIAL_STACK_SIZE from #define to static int

    2.  Get rid of #defines of begin/commit, in favor of slon_dstrings

    3.  Add an initial query, at monitor thread start time, which
        purges old data out of sl_components.

        We removed the other way of cleaning it out, but surely still
        need a way.

    4.  Some memory allocation fixes

    5.  stack_dump() now locks the stack_lock mutex, entry_dump() comments
        warn that users of it need to take that lock.

    6.  Annotate parms of monitor_state() with "const" as needful

commit 03f52daf1fb7ae2d819ecd0c411342a594f6884d
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Mar 15 12:32:57 2011 -0400

    Remove comment per suggestion in review

commit 0543c96506eb55012c4366f78009f886b9464d59
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Mar 15 12:32:29 2011 -0400

    Add conf option, monitor_threads, which controls whether or not the monitoring thread is run

commit 7a3c5f54dcf72bcf67a49f6ed5b80ed673fc0ed5
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Mar 14 18:31:59 2011 -0400

    Remove deletion query on sl_components, per recommendation from Steve in the patch review

commit 72ed0337641eefda095cfcb706562d71d9c03413
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Mar 14 16:44:02 2011 -0400

    Revisions to docs per Steve's comments

commit c6082bc77f460e985c7a2891c45269c9648347c9
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Mar 14 16:43:22 2011 -0400

    Remove default - if we're using slon timestamps, we shouldn't try to default to the DB server's timestamp

commit e6b947c39272030208341e9fd240f7760be89410
Merge: a2e7b12 6572ed1
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 25 18:32:29 2011 -0500

    Merge branch 'master' of git://git.postgresql.org/git/slony1-engine into bug175

commit a2e7b12a90209d03ae2064d505db7909fab29b88
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 25 13:07:48 2011 -0500

    Add check on sl_components to cluster state test scripts

commit a546892938506294ee8baae24c4a1bfafc33fb46
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 25 12:43:10 2011 -0500

    Add more documentation regarding sl_components interpretation, including more on need for NTP synchronization

commit 54eaf2dd5bbdd3f18966c2d7d494cb8ddcea6dc2
Merge: f0ff740 b750db3
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 25 11:28:57 2011 -0500

    Merge branch 'master' of git://git.postgresql.org/git/slony1-engine into bug175

commit f0ff740171f3794e2113545756e44d2e8a4554cc
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 24 17:50:13 2011 -0500

    Add emacs directory locals

commit f2a4f355e08365c6b6707ca6d6e2f756637c4c63
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 24 14:42:54 2011 -0500

    Run pgindent on monitoring code

commit 21b78047c79c45d04416c8fe4a08cdb92fff79a6
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 24 12:11:47 2011 -0500

    Set initial stack size to 6.  This suffices for simple clusters, as typical contents look like:

    slonyregress1@localhost->  select * from _slony_regress1.sl_components  order by co_actor;
           co_actor       | co_pid | co_node | co_connection_pid |   co_activity    |      co_starttime      | co_event | co_eventtype
    ----------------------+--------+---------+-------------------+------------------+------------------------+----------+--------------
     local_cleanup        |  24586 |       0 |             24907 | thread main loop | 2011-02-24 17:02:55+00 |          | n/a
     local_listen         |  24896 |       1 |             24900 | thread main loop | 2011-02-24 17:03:03+00 |          | n/a
     local_monitor        |  24586 |       0 |             24909 | thread main loop | 2011-02-24 17:02:55+00 |          | n/a
     local_sync           |  24517 |       0 |             24906 | thread main loop | 2011-02-24 17:03:05+00 |          | n/a
     remote listener      |  24586 |       2 |             24910 | thread main loop | 2011-02-24 17:03:03+00 |          | n/a
     remoteWorkerThread_2 |  24586 |       2 |             24908 | thread main loop | 2011-02-24 17:02:55+00 |          | n/a
    (6 rows)

commit a77fc6cbf80b1bacdad168a25cd51c31ef27daf2
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 24 12:04:14 2011 -0500

    Fixed memory allocation problems with monitoring thread stack

commit 1e5f6127d1a27ee1d61f36ee7ebad472fe979211
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 22 16:29:47 2011 -0500

    Remove pid parm from monitor_state() -  collect that consistently inside the function

commit 36e578301546679a8d8975525a1a84b6736012fe
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 22 16:28:15 2011 -0500

    Improving comments on sl_components

commit bac60dce1063678de66e239f2bdf6765fcdb0a99
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 22 16:27:53 2011 -0500

    Add documentation on connections, fixing some SGML tagging problems

commit 1c7b1d456ff2518e77d164ba5b6a2358bc734e84
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 18 18:04:10 2011 -0500

    Add section on monitoring that describes the new sl_components

commit cdbcaacb1b1c5732a739e51d0b3f0a58c5bc86c2
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 18 15:53:59 2011 -0500

    More activity monitoring in remote_worker threads

commit 410bff78bc8da1c0cb6b222965ac50ea9341c1ed
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 18 15:46:07 2011 -0500

    Remove spurious debugging code

commit 55ae2a5c266f1bf5ed5dbc0b9f5576aca0bfc096
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 18 15:45:13 2011 -0500

    Add in monitor_state() calls inside operation loops to indicate when these threads are doing work

commit 65d34b6de01df6117e37aadd8abe341b4469a37d
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 18 15:44:11 2011 -0500

    Fixing up memory allocation errors

commit ad52f7e961e72962c10c2b1ce3099003f81fa305
Merge: 76e3502 04c1986
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 18 12:32:34 2011 -0500

    Merge branch 'master' of git://git.postgresql.org/git/slony1-engine into bug175

commit 76e350232d6422b029d204344e5f8e1b7d32eea1
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 17 15:34:35 2011 -0500

    Redo monitor thread using a stack, with the optimization that if the latest entry is for the same component, we overwrite, rather than recording an extra element.

commit f14af6c3bb9cd8dcb1603e47e2744b239d06885a
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 17 15:33:35 2011 -0500

    actor is now PK for sl_components, not the previous composite

commit c642ba97a2e24db170b0927a873f497d9035d372
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 17 15:32:38 2011 -0500

    primary key for components is now on actor...
    Also, don't bother recording an update to sl_component that is newer than the present entry

commit 87089c80d660f6188eab5097c5413a4b7cf925ff
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 17 15:30:39 2011 -0500

    Shift to using malloc'ed stack array means we don't need this queue struct

commit 55746482ed77e5833e31a2d5730f8e1fae6ae51c
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Wed Feb 16 15:17:04 2011 -0500

    Allocate space for NUL for strings

commit b7253ae109b0075b66237f082af9cb5217e9c435
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 15 16:48:14 2011 -0500

    Fixing casts on monitoring code

commit 6b4a98137f951e31d438b816b9124c6b8e18f420
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 15 16:47:41 2011 -0500

    appendquery function should return void.  Change types of PIDs to pid_t

commit 07dcc554baa1a9af2db8664daebe523f59464964
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 15 15:58:49 2011 -0500

    Cleanup of function prototypes

commit 434716fc74a911dbeceba1521cfe5623dbec7825
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 15 15:52:31 2011 -0500

    Fixes resulting from SPLINT analysis

commit 37dad19295aa5606592c5372a6b5bcbb106e9fe9
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 15 15:51:40 2011 -0500

    set default for connpid to ensure there's guaranteed always a value

commit c9667dd5906dd269f4b7c5995350d6e8643eb227
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 15 13:23:49 2011 -0500

    Change some functions returning INT to return VOID to reduce warnings & such

commit b58a72e7272d1ca96792141482058a048aa3afa7
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 15 12:33:36 2011 -0500

    do local malloc() for copies of monitoring labels

commit f92f86ff32a2c39fd5e6282961d5aa999cad728f
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 15 12:32:53 2011 -0500

    Pass NULL rather than empty string to monitor_state()

commit 54ab45829a6242716de30f9af177513244fdbf5c
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Feb 14 12:44:17 2011 -0500

    Numerous revisions to monitoring

commit 4c64fbe276bf579ec3949e963de8dcfb837d1fda
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Feb 14 12:40:01 2011 -0500

    Capture connection PID for local_listen thread

commit 7136e148d027891d19bd696c1c598f57744ef783
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Feb 14 12:39:37 2011 -0500

    Make connection PID mandatory

commit 5b174f9d33aa2a21163fd49369c06e249e4617b8
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Feb 14 12:28:25 2011 -0500

    Capture connection PID for monitoring

commit 1b00ff5daa5a363531f2f507fb1e369f7d33ddc6
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Feb 14 12:07:19 2011 -0500

    rename query strings, refactor

commit e2f8d344136b3531bd5fe504733b565c6e9ce5f2
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Feb 14 12:04:46 2011 -0500

    Instrument the local listen thread with monitor_state()

commit 6b45354d0cd1b0ff13c1017186b0950c69e982e0
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 11 18:18:59 2011 -0500

    Lots more debugging done

commit b94243a198af131b2dc98bc02d5410fab528ea38
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 11 18:18:36 2011 -0500

    Change default timing for monitoring thread to dump results every 500ms, add docs for this option

commit ed670f0e6b5f06aa80d1fe8e407765cc67948b78
Merge: 17bdfdf 692fa16
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Feb 11 15:49:11 2011 -0500

    Merge branch 'master' of git://git.postgresql.org/git/slony1-engine into bug175

commit 17bdfdf63295138d5439384f48c6ad80c72af03c
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 10 17:57:12 2011 -0500

    Lots of changes to monitor thread.  It doesn't quite work, but it's now getting close

commit b8101ab3b85aec1f25f287b059bc583c9c7739ce
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 10 17:44:17 2011 -0500

    Change to use UPDATE so we'll frequently get to do HOT updates

commit a32838fde66ef9481681f80ac4ea82103fd43914
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 10 17:36:19 2011 -0500

    Query listed co_event too many times

commit 7cb0500a59265ca585fce82437069535a44a40e5
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Feb 10 17:35:53 2011 -0500

    Activity isn't mandatory - Listeners aren't normally busy doing things

commit b81d6f811ae109481ae6e6a055cae8a1f8afdbbe
Merge: 7239af7 f7ceb47
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Feb 8 15:36:17 2011 -0500

    Merge branch 'master' into bug175

commit 7239af790b0e103ceefee82a3cb0a7f0803b372e
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Mon Dec 20 18:11:52 2010 -0500

    Debugging monitoring code - next steps...

commit 3d1380144a3b1dc320b37154547f76494235385e
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Dec 17 17:55:56 2010 -0500

    Revise monitoring API to reduce parms needed, and start instrumenting remote worker main loop

commit 16f722db1e6bf2be2b055a82f66999d8e5babd35
Merge: e08b3cf 379e4d6
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Dec 17 17:43:27 2010 -0500

    Merge branch 'master' into bug175

    Conflicts:
     src/backend/slony1_funcs.sql

commit e08b3cf11c0d36eec936071df493ab6a93859046
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Dec 17 17:39:55 2010 -0500

    Loose implementation of API for queueing updates to states of slony components, and draining the queue to record the queries in DB

commit 0eaac89aec7f86b601d8e1f9711123b784f62008
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Dec 17 17:38:52 2010 -0500

    Add API for recording monitoring of component states

commit 99cbd9cc2ab8ac07da0b5cf2f822b1cd69d47246
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Dec 17 17:38:11 2010 -0500

    Add monitor_interval parameter to control how often the monitoring queue gets flushed

commit 8c2997b2a6ec5ffeef40a575570ab1574c9ee7d1
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Dec 17 17:37:39 2010 -0500

    Reformatting & such of monitoring table

commit 5a8cc861c59d591ebbf6de00b54a265e3cdac05b
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Fri Dec 17 17:36:55 2010 -0500

    Function to record component state for monitoring

commit 125ccb17e9e80db37d3f78e2ea62b56395d68ab7
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Dec 16 16:17:47 2010 -0500

    Upon startup of connections, capture the PID into SlonConn structure

commit 31e3547ad4d128f4f1c38165673fb4d3319c7cce
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Dec 16 16:17:18 2010 -0500

    Put proper comments on sl_components

commit aeed5716509029ce84a5b6fc19bc5e76c00d3d4f
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Dec 14 13:16:07 2010 -0500

    Add preliminary code for monitoring thread

commit b61746b0fab22c8c67df3318dc42813407912287
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Tue Dec 14 13:15:37 2010 -0500

    Add a preliminary schema for monitoring table

14 years agoSquashed commit of the following:
Christopher Browne [Fri, 18 Mar 2011 18:54:56 +0000 (14:54 -0400)]
Squashed commit of the following:

commit 1ac7c028e3151e30ef3976dde09b6b4c622f1a13
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Mar 3 12:49:31 2011 -0500

    Add bug #198 to release notes

commit 0774976398221ab11b7df195749224920eaf43cb
Author: Christopher Browne <cbbrowne@ca.afilias.info>
Date:   Thu Mar 3 12:48:38 2011 -0500

    Add test that the provider node exists

14 years agoAdd bug #198 to release notes
Christopher Browne [Thu, 3 Mar 2011 17:49:31 +0000 (12:49 -0500)]
Add bug #198 to release notes

14 years agoAdd release note for #196
Christopher Browne [Wed, 2 Mar 2011 19:45:47 +0000 (11:45 -0800)]
Add release note for #196

14 years agoAdd guard (via locking sl_event_lock) to ESTABLISH_SUBSCRIPTION event creation.
Christopher Browne [Wed, 2 Mar 2011 19:42:30 +0000 (14:42 -0500)]
Add guard (via locking sl_event_lock) to ESTABLISH_SUBSCRIPTION event creation.

Also, revise README to mention this issue.

14 years agoThere a few more places to adjust, as there are stored functions that generate events:
Christopher Browne [Wed, 2 Mar 2011 18:04:13 +0000 (13:04 -0500)]
There a few more places to adjust, as there are stored functions that generate events:

a) failednode2() generates an event, so the table needs to be locked before calling this function in src/slonik/slonik.c

b) failoverSet_int() generates an event, hence src/slon/remote_worker.c needs to lock the table first.

14 years agoReplace pre_event_create() calls with LOCK TABLE sl_event_lock, to eliminate race...
Christopher Browne [Wed, 2 Mar 2011 15:30:44 +0000 (10:30 -0500)]
Replace pre_event_create() calls with LOCK TABLE sl_event_lock, to eliminate race condition properly.

14 years agoNo value in having pre_event_create() function... That leaves the race condition...
Christopher Browne [Wed, 2 Mar 2011 15:29:42 +0000 (10:29 -0500)]
No value in having pre_event_create() function...  That leaves the race condition in place.
We need to submit the LOCK TABLE request *immediately* after the BEGIN, with *NO* database logic intervening at all

14 years agoAdd sl_event_lock table that is what gets locked to prevent mis-serialization of...
Christopher Browne [Tue, 1 Mar 2011 20:05:15 +0000 (15:05 -0500)]
Add sl_event_lock table that is what gets locked to prevent mis-serialization of creation of sl_event entries.

Add pre_event_create() function that takes out that lock which will be called by anything that does an event create.

Add code to upgrade schema function which creates sl_event_lock if it is missing.

Slon SYNC thread needs to call pre_event_create() before calling createEvent().

Various functions for slonik actions call pre_event_create() before calling createEvent().

14 years agoAdd emacs directory locals
Christopher Browne [Thu, 24 Feb 2011 22:50:13 +0000 (17:50 -0500)]
Add emacs directory locals