bucardo.git
12 years agoAdd a double-multi-master replication makedelta test.
David E. Wheeler [Wed, 12 Dec 2012 01:06:52 +0000 (17:06 -0800)]
Add a double-multi-master replication makedelta test.

Consider this:

* You have two databases, A and B, with multi-master replication between all
  of their tables.
* You have a third database, C that needs to be the target of replication for
  just one of those tables, "widgets".
* If A goes down, C stil needs the widgets updated on B.

Solution:

* Add a relgroup with just "widgets"
* Enalbe "makedelta" on "widgets"
* Add a dbgroup with A:source, B:source, C:target
* Create a sync with that dbgroup and the widgets-only relgroup.

This is effectively the case these new tests demonstrate. However, it means
that there are *two* multi-master replication syncs between A and B for the
"widgets" table. This is a bit of a drag, as it means that everything will be
synced twice.

But not only that, if A goes down, will the sync with C as the target succeed
or fail?

12 years agoGet `makedelta` tests passing.
David E. Wheeler [Wed, 12 Dec 2012 00:49:03 +0000 (16:49 -0800)]
Get `makedelta` tests passing.

Requires two things:

1. Restore the insert into the track table that was removed in d2d2cbd1d2.
   Otherwise, when the autokick kicks off the sync after the sync from A to B,
   the data is synced back to A. Then back to B, and on and on.
2. Modify `wait_for_notice()` to handle a list of notices to wait for. This is
   beause the syncdone message can be sent in random order, so we were getting
   failures by listening for one and then another. So we allow an array
   reference of notices to be passed, and it will wait for them all.

12 years agoRestore listen for syncdone_deltatest2.
David E. Wheeler [Tue, 11 Dec 2012 19:51:52 +0000 (11:51 -0800)]
Restore listen for syncdone_deltatest2.

It is now triggered properly.

12 years agoFor the makedelta system, we'll store everything at the goat/table level: the new...
Greg Sabino Mullane [Tue, 11 Dec 2012 07:00:02 +0000 (02:00 -0500)]
For the makedelta system, we'll store everything at the goat/table level: the new value is a list of databases. Remove makedelta from the db table, as it is no longer needed.

12 years agoBetter makedelta work: this should allow things to work mostly as intended now.
Greg Sabino Mullane [Tue, 11 Dec 2012 06:55:35 +0000 (01:55 -0500)]
Better makedelta work: this should allow things to work mostly as intended now.

12 years agoMore makedelta work, write out some ideas.
Greg Sabino Mullane [Tue, 11 Dec 2012 06:53:19 +0000 (01:53 -0500)]
More makedelta work, write out some ideas.

12 years agoPlaceholder for populating is_makedelta
Greg Sabino Mullane [Tue, 11 Dec 2012 06:47:59 +0000 (01:47 -0500)]
Placeholder for populating is_makedelta

12 years agoFor makedelta, we need to set it as on/off per table inside each database. We do...
Greg Sabino Mullane [Tue, 11 Dec 2012 06:42:24 +0000 (01:42 -0500)]
For makedelta, we need to set it as on/off per table inside each database. We do this via the is_makedelta attribute. If this is set, we can walk through at the end and force a track/stage update as needed, in the case where we had no delta changes on the makedelta table in question, but some other database did - which means that it put some new rows inside our delta table. Note that we don't need to explicitly update the track table, as the normal insert/update/where not exists SQL handles this case just fine.
Still to do: populate is_makedelta, based on what is in goat.makedelta and possibly also db.makedelta.

12 years agoThis is where the makedelta track update happens.
Greg Sabino Mullane [Tue, 11 Dec 2012 06:24:39 +0000 (01:24 -0500)]
This is where the makedelta track update happens.

12 years agoThis is not the place to update track
Greg Sabino Mullane [Tue, 11 Dec 2012 06:19:23 +0000 (01:19 -0500)]
This is not the place to update track

12 years agoNo longer need to worry about explicit kick after makedelta
Greg Sabino Mullane [Tue, 11 Dec 2012 05:46:53 +0000 (00:46 -0500)]
No longer need to worry about explicit kick after makedelta

12 years agoLet's make the triggerkick triggers always: this should solve one of the makedelta...
Greg Sabino Mullane [Tue, 11 Dec 2012 05:44:42 +0000 (00:44 -0500)]
Let's make the triggerkick triggers always: this should solve one of the makedelta issues.

12 years agoLet's make table-level makedelta an open field for future ideas.
Greg Sabino Mullane [Tue, 11 Dec 2012 04:13:24 +0000 (23:13 -0500)]
Let's make table-level makedelta an open field for future ideas.

12 years agoFirst stab at getting makedelta working again.
David E. Wheeler [Tue, 11 Dec 2012 01:27:43 +0000 (17:27 -0800)]
First stab at getting makedelta working again.

Add code to push_rows() that inserts the proper delta and track records if the
target is PostgreSQL. Tests fail just as before because nothing tickles the
autokick, which is disabled by the replication KID. There is a NOTIFY for a
makedelta job, though, so perhaps that can be used?

12 years agoUse arrays.
David E. Wheeler [Mon, 10 Dec 2012 23:38:36 +0000 (15:38 -0800)]
Use arrays.

12 years agoTest makedelta vs non-makedelta.
David E. Wheeler [Mon, 10 Dec 2012 22:54:14 +0000 (14:54 -0800)]
Test makedelta vs non-makedelta.

By adding another test table with makedelta=off. Also, make sure that there
are not duplicate/multiple syncdone messages, as they would indicate circulare
replication patterns (as were present in 964ac9b and removed in 9e7227e).
Resolves #19.

12 years agoRevert "Try always committing deltas on 8.4 and higher."
David E. Wheeler [Mon, 10 Dec 2012 22:34:06 +0000 (14:34 -0800)]
Revert "Try always committing deltas on 8.4 and higher."

This reverts commit 964ac9b960bf85fe7bf01d0ece9f944170f20703.

12 years agoTry always committing deltas on 8.4 and higher.
David E. Wheeler [Fri, 7 Dec 2012 01:05:01 +0000 (17:05 -0800)]
Try always committing deltas on 8.4 and higher.

If we always log deltas and kick queues, we *never* need a `makedelta` option.
I'm not sure if this will really work in practice, however, for these reasons:

* I'm not entirely sure how Bucardo will handle the dupes. Given the previous
  presence of `makedelta`, I'm assuming fine, but even so I'm not sure we want
  to *always* enable them: it could create a lot more traffic between nodes.
  This could potentially be mediated by adding separate delta functions for
  each table and sync, but that might be a PITA.
* There is a failing test in t/40-postgres.t -- the very last test, in fact.
  Something related to customcols: Database D ends up with the rows values 30,
  60, 90, and 210 rather than 2, 3, 7, and 30. I am unable to figure out why
  this would be.
* There may be some other consequence of doing this that could break things
  that I, in my ignorance, and completely unaware of.
* This leaves older versions of PostgreSQL behind. But maybe we don't care?
  8.3 is mighty old (I suspect that today's release of 8.3.22 will be the
  last).

However, given all that, if this could be made to work, it's pretty damned
simple! If not, please revert this and we can come up with something else.
(Ref issue #19).

12 years agoGet `help add customcols` working.
David E. Wheeler [Fri, 7 Dec 2012 00:58:20 +0000 (16:58 -0800)]
Get `help add customcols` working.

12 years agoFix failing fullcopy test.
David E. Wheeler [Fri, 7 Dec 2012 00:23:01 +0000 (16:23 -0800)]
Fix failing fullcopy test.

The code deleted here was added in 63a425f0ef2b018f03eef9dd7486a7c1a9b2a390.
However, in my testing on PostgreSQL 9.2, the sequence replication tests in
t/10-fullcopy.t failed. I tried changing `defined` to `exists` but it did not
help. So I'm thinking there must be a better way to deal with sequence
attributes in older versions of PostgreSQL, though I don't know what it might
be.

12 years agoFix test failuers on later Postgres releases.
David E. Wheeler [Fri, 7 Dec 2012 00:12:43 +0000 (16:12 -0800)]
Fix test failuers on later Postgres releases.

In 2d7f462e2a3ccc0ee370e10aac8811c33fbde999, Greg changed the calls to `ALTER
SEQUENCE` so that they work for older versions of PostgreSQL. However, it
broke newer versions (I'm testing on 9.2.2). It looks like the `START` clause
was added in 8.4, so let's use it as we did before for 8.4 and higher and
leave it out for 8.3 and older.

12 years agoUpdate TODOs.
David E. Wheeler [Thu, 6 Dec 2012 22:51:43 +0000 (14:51 -0800)]
Update TODOs.

12 years agoAdd failing makedelta test.
David E. Wheeler [Thu, 6 Dec 2012 22:44:47 +0000 (14:44 -0800)]
Add failing makedelta test.

Towards getting `makedelta` working again (Issue #19).

There is a `wait_for_notice` commented out, and a failing assertion on line
88. Once makedelta is fixed, the test should pass and the commented-out test
should be uncommented.

12 years agoRemove `update relgroup`.
David E. Wheeler [Tue, 27 Nov 2012 00:35:21 +0000 (16:35 -0800)]
Remove `update relgroup`.

It was never implemented. Closes #22.

12 years agoBare minimum seems to be 8.2. Tried 8.1 and it has lots of issues: too many to worry...
Greg Sabino Mullane [Tue, 27 Nov 2012 00:16:06 +0000 (19:16 -0500)]
Bare minimum seems to be 8.2. Tried 8.1 and it has lots of issues: too many to worry about fixing.

12 years agoFacebook
Greg Sabino Mullane [Fri, 16 Nov 2012 15:49:35 +0000 (10:49 -0500)]
Facebook

12 years agoMore testing workarounds to support non-truncate-trigger Postgres versions. WIP.
Greg Sabino Mullane [Fri, 9 Nov 2012 14:22:23 +0000 (09:22 -0500)]
More testing workarounds to support non-truncate-trigger Postgres versions. WIP.

12 years agoSupport older versions by simply skipping unknown sequence attributes.
Greg Sabino Mullane [Thu, 8 Nov 2012 22:39:46 +0000 (17:39 -0500)]
Support older versions by simply skipping unknown sequence attributes.

12 years agoMinor changes to support older PG versions
Greg Sabino Mullane [Thu, 8 Nov 2012 16:04:07 +0000 (11:04 -0500)]
Minor changes to support older PG versions

12 years agoMake sure we support PGBINDIR inside bucardo for the psql variable too.
Greg Sabino Mullane [Thu, 8 Nov 2012 12:57:33 +0000 (07:57 -0500)]
Make sure we support PGBINDIR inside bucardo for the psql variable too.

12 years agoNotes about testing different versions of Postgres
Greg Sabino Mullane [Thu, 8 Nov 2012 03:46:14 +0000 (22:46 -0500)]
Notes about testing different versions of Postgres

12 years agoWe might allow synonyms, but we need to make sure the tests are looking for the retur...
Greg Sabino Mullane [Thu, 8 Nov 2012 03:18:55 +0000 (22:18 -0500)]
We might allow synonyms, but we need to make sure the tests are looking for the returned literal 'relgroup', not 'herd'

12 years agoAdd support for multiple log destinations to chkconfig script.
David E. Wheeler [Wed, 7 Nov 2012 19:59:54 +0000 (11:59 -0800)]
Add support for multiple log destinations to chkconfig script.

Also sleep for 2 seconds between start and stop in the `restart` command.

12 years agoUpdate Changes in bucardo.spec.
David E. Wheeler [Wed, 7 Nov 2012 00:54:08 +0000 (16:54 -0800)]
Update Changes in bucardo.spec.

12 years agoSignature for version 4.99.6 (Version 5, beta 6) 4.99.6
Greg Sabino Mullane [Tue, 6 Nov 2012 23:59:03 +0000 (18:59 -0500)]
Signature for version 4.99.6 (Version 5, beta 6)

12 years agoAdd more logging for conflict handling activity.
Greg Sabino Mullane [Tue, 6 Nov 2012 22:38:34 +0000 (17:38 -0500)]
Add more logging for conflict handling activity.

12 years agoThis test is still a work in progress.
Greg Sabino Mullane [Tue, 6 Nov 2012 22:38:09 +0000 (17:38 -0500)]
This test is still a work in progress.

12 years agoNo tabs
Greg Sabino Mullane [Tue, 6 Nov 2012 20:19:08 +0000 (15:19 -0500)]
No tabs

12 years agoSkip patch files when checking for tabs.
Greg Sabino Mullane [Tue, 6 Nov 2012 20:18:58 +0000 (15:18 -0500)]
Skip patch files when checking for tabs.

12 years agoglog call forgot the level.
Greg Sabino Mullane [Tue, 6 Nov 2012 20:18:45 +0000 (15:18 -0500)]
glog call forgot the level.

12 years agoKeep all the custom code types in one place.
David E. Wheeler [Tue, 6 Nov 2012 19:33:11 +0000 (11:33 -0800)]
Keep all the custom code types in one place.

12 years agoIgnore MANIFEST.bak.
David E. Wheeler [Tue, 6 Nov 2012 19:16:52 +0000 (11:16 -0800)]
Ignore MANIFEST.bak.

12 years agoUpdate manifest with `make manifest`.
David E. Wheeler [Tue, 6 Nov 2012 19:16:15 +0000 (11:16 -0800)]
Update manifest with `make manifest`.

Exclude .db and .bak files.

12 years agoFix failing test.
David E. Wheeler [Tue, 6 Nov 2012 19:09:12 +0000 (11:09 -0800)]
Fix failing test.

Just needed quotation marks.

12 years agoPut custom code into its own package.
David E. Wheeler [Tue, 6 Nov 2012 19:05:58 +0000 (11:05 -0800)]
Put custom code into its own package.

So that globals are not immediately available. Also set $_ to the same value
as the hash ref passed in.

12 years agoSpelling updates.
Greg Sabino Mullane [Tue, 6 Nov 2012 03:25:02 +0000 (22:25 -0500)]
Spelling updates.

12 years agoAdd our example customcode file to the manifest.
Greg Sabino Mullane [Mon, 5 Nov 2012 22:59:26 +0000 (17:59 -0500)]
Add our example customcode file to the manifest.

12 years agoMore customcode work.
Greg Sabino Mullane [Mon, 5 Nov 2012 22:26:32 +0000 (17:26 -0500)]
More customcode work.

12 years agoAllow custom code status to be set.
David E. Wheeler [Mon, 5 Nov 2012 20:11:11 +0000 (12:11 -0800)]
Allow custom code status to be set.

12 years agoUse nicer code deref.
David E. Wheeler [Mon, 5 Nov 2012 20:05:43 +0000 (12:05 -0800)]
Use nicer code deref.

12 years agoImprove compilation of custom code.
David E. Wheeler [Mon, 5 Nov 2012 19:52:11 +0000 (11:52 -0800)]
Improve compilation of custom code.

Poperly use the custom code source as the body of an `eval`ed subroutine
reference, rather than `eval` it on every call. This has two benefits:

* `shift` works properly in the custom code.
* We no longer need the `dummy` key, as the compilation should give us all we
  need.

I've also `local`ed `$_` to prevent leakage. Frankly, we might want to have it
`eval`ed in a completely separate package with all globals reset. Or better
yet, use Safe.pm.

If we still want to execute the function before we approve it, we can put the
`dummy` back, but I don't think that gains us anything, as nothing really runs
in that case other than the check for `dummy`.

12 years agoDocument more keys in the hash passed to custom codes.
David E. Wheeler [Mon, 5 Nov 2012 19:13:15 +0000 (11:13 -0800)]
Document more keys in the hash passed to custom codes.

12 years agoAdd description of each customcode item that can be updated.
David E. Wheeler [Mon, 5 Nov 2012 18:36:40 +0000 (10:36 -0800)]
Add description of each customcode item that can be updated.

12 years agoBasic test of `update customcode`.
David E. Wheeler [Mon, 5 Nov 2012 18:32:41 +0000 (10:32 -0800)]
Basic test of `update customcode`.

Gets customcode exception test passing again.

12 years agoChange customcode.status default to "active".
David E. Wheeler [Mon, 5 Nov 2012 17:59:32 +0000 (09:59 -0800)]
Change customcode.status default to "active".

It is a text column, not a boolean, and Bucardo.pm looks for "active".

12 years agoMerge branch 'master' of ln6.endpoint.com:/var/lib/git/bucardo
Greg Sabino Mullane [Mon, 5 Nov 2012 17:41:33 +0000 (12:41 -0500)]
Merge branch 'master' of ln6.endpoint.com:/var/lib/git/bucardo

12 years agoWork on supporting 'bucardo update customcode'
Greg Sabino Mullane [Mon, 5 Nov 2012 17:40:53 +0000 (12:40 -0500)]
Work on supporting 'bucardo update customcode'
Still needs to possibly support more attributes.
Also may remove the priority, if it makes more sense just in the customcode_map

12 years agoFix serialization and deadlock error detection.
David E. Wheeler [Mon, 5 Nov 2012 17:20:10 +0000 (09:20 -0800)]
Fix serialization and deadlock error detection.

0406ecb added deadlock detection, but forgot to put the list of error states
to check after the call to `first {}` for both serialization and deadlock
detection. So fix that. The serialization test passes again.

12 years agoChomp schema lines before adding configs.
David E. Wheeler [Mon, 5 Nov 2012 17:15:09 +0000 (09:15 -0800)]
Chomp schema lines before adding configs.

12 years agoDuh, $count can be 0E0.
David E. Wheeler [Mon, 5 Nov 2012 17:01:41 +0000 (09:01 -0800)]
Duh, $count can be 0E0.

12 years agoComplete and working test for exception handling!
Greg Sabino Mullane [Mon, 5 Nov 2012 16:49:54 +0000 (11:49 -0500)]
Complete and working test for exception handling!

12 years agoAdd status field to the customcode table, so we can easily toggle them off if needed.
Greg Sabino Mullane [Mon, 5 Nov 2012 16:49:25 +0000 (11:49 -0500)]
Add status field to the customcode table, so we can easily toggle them off if needed.

12 years agoTweak customcode exception example
Greg Sabino Mullane [Mon, 5 Nov 2012 15:12:03 +0000 (10:12 -0500)]
Tweak customcode exception example

12 years agoMore cleanups of the exception custom handler code.
Greg Sabino Mullane [Mon, 5 Nov 2012 03:57:26 +0000 (22:57 -0500)]
More cleanups of the exception custom handler code.

12 years agoGoodbye customcode.trigrules
Greg Sabino Mullane [Sun, 4 Nov 2012 16:30:07 +0000 (11:30 -0500)]
Goodbye customcode.trigrules

12 years agoSpelling
Greg Sabino Mullane [Sun, 4 Nov 2012 16:25:38 +0000 (11:25 -0500)]
Spelling

12 years agoClean up the customcode SQL so it no longer errors out when no matching goat-level...
Greg Sabino Mullane [Sun, 4 Nov 2012 03:39:32 +0000 (23:39 -0400)]
Clean up the customcode SQL so it no longer errors out when no matching goat-level customcodes.

12 years agoChipping away on some cc exception work.
Greg Sabino Mullane [Sun, 4 Nov 2012 03:25:58 +0000 (23:25 -0400)]
Chipping away on some cc exception work.

12 years agoMake a todo about showing deadlock information in payload.
Greg Sabino Mullane [Sun, 4 Nov 2012 03:16:39 +0000 (23:16 -0400)]
Make a todo about showing deadlock information in payload.

12 years agoSneaky tabs, how we hates them!
Greg Sabino Mullane [Sun, 4 Nov 2012 02:28:34 +0000 (22:28 -0400)]
Sneaky tabs, how we hates them!

12 years agoBe more explicit if we know the reason for failing to install is lack of Pl/PerlU
Greg Sabino Mullane [Sun, 4 Nov 2012 02:06:15 +0000 (22:06 -0400)]
Be more explicit if we know the reason for failing to install is lack of Pl/PerlU

12 years agoDuh. Should be < 0, not 1. Thanks David.
Greg Sabino Mullane [Sat, 3 Nov 2012 23:33:02 +0000 (19:33 -0400)]
Duh. Should be < 0, not 1. Thanks David.

12 years agoBump version in RPM spec file.
David E. Wheeler [Sat, 3 Nov 2012 22:42:31 +0000 (15:42 -0700)]
Bump version in RPM spec file.

12 years agoAdd dist/ to MANIFEST
Greg Sabino Mullane [Sat, 3 Nov 2012 19:32:36 +0000 (15:32 -0400)]
Add dist/ to MANIFEST

12 years agoBump version to 4.99.6 in preparation for next beta.
Greg Sabino Mullane [Sat, 3 Nov 2012 19:30:44 +0000 (15:30 -0400)]
Bump version to 4.99.6 in preparation for next beta.
No HTML files as 'make html' is making too many changes at the moment.

12 years agoAdd some tests to the MANIFEST
Greg Sabino Mullane [Sat, 3 Nov 2012 19:22:16 +0000 (15:22 -0400)]
Add some tests to the MANIFEST

12 years agoAdd test skeleton for custom code exception handling.
Greg Sabino Mullane [Sat, 3 Nov 2012 19:19:21 +0000 (15:19 -0400)]
Add test skeleton for custom code exception handling.

12 years agoUncuddle for consistency.
Greg Sabino Mullane [Sat, 3 Nov 2012 19:11:54 +0000 (15:11 -0400)]
Uncuddle for consistency.

12 years agoGet rid of that pesky -w: causing problems with ancient versions of "env"
Greg Sabino Mullane [Sat, 3 Nov 2012 19:04:07 +0000 (15:04 -0400)]
Get rid of that pesky -w: causing problems with ancient versions of "env"

12 years agoQuick addition of kid retry on deadlock, similar to serialization. Also allow to...
Greg Sabino Mullane [Sat, 3 Nov 2012 19:03:09 +0000 (15:03 -0400)]
Quick addition of kid retry on deadlock, similar to serialization. Also allow to set to -1 to prevent the kid from retrying at all. Although the controller may restart a new kid anyway, this is a start.

12 years agoRevert "Don't use /usr/bin/env."
Greg Sabino Mullane [Sat, 3 Nov 2012 18:39:01 +0000 (14:39 -0400)]
Revert "Don't use /usr/bin/env."

This reverts commit 790ad8c1ecf28fb37ac8e0ac654cecedc8b88eaa.

No, we are not going to hardcode /usr/bin/perl, as this will break things for at least one major user of Bucardo. If the -w is the problem, remove that, but keep /usr/bin/env please.

12 years agoDon't use /usr/bin/env.
David E. Wheeler [Sat, 3 Nov 2012 17:10:24 +0000 (10:10 -0700)]
Don't use /usr/bin/env.

Older versions do not recognize when options are passed to the program. IOW, `/usr/bin/env perl -w` dies.

12 years agoAdd test for serialization failure.
David E. Wheeler [Fri, 2 Nov 2012 21:40:36 +0000 (14:40 -0700)]
Add test for serialization failure.

Should work on Postgres 8.4 and higher, and skip all on older versions. Works
by adding a sequence and a trigger to a target table, and configuring the
trigger to fire only when the `session_replica_role` is "replica". This means
that it fires when data is `COPY`ed into the table from the source.

The trigger calls a PL/pgSQL function that consults a sequence, and thows a
serialization failure exception when the next value from the sequence is odd.
It does not throw it when its value is even. The result is that the first
attempt to copy the data into the table throws the serialization exception,
but the second attempt does not.

The test checks that the serialization failure happens by listening for the
`syncsleep` notification. If it doesn't come, there was no serialization
failure, and the test fails. If there is, it then tests that the sync finished
anyway and that the new data was copied over.

Resolves #29.

In passing, I've also changed the formatting of the message about the duration
of the sleep to use a stringification of that time, rather than turning it
into an integer, since the new default is 0.5 (and using `%f` yieled too many
decimal places). And if the sleep time is 0, we don't call sleep and send
a slightly different message.

It might make sense to send the sleep nofication only if we're going to sleep,
and then to always send another message, say serialretry, just before trying
again. I think that would be cleaner, since it does not actually always sleep.
Thoughts?

12 years agoNo, really properly check for the old bucarodo_sequences table.
David E. Wheeler [Fri, 2 Nov 2012 16:47:14 +0000 (09:47 -0700)]
No, really properly check for the old bucarodo_sequences table.

The query returns true if the new table is present, not if the old one
is present.

12 years agoProperly check for old bucardo_sequenes table.
David E. Wheeler [Fri, 2 Nov 2012 16:45:53 +0000 (09:45 -0700)]
Properly check for old bucardo_sequenes table.

The logic was off before.

12 years agoProperly check for presence of old bucardo_sequences table.
David E. Wheeler [Fri, 2 Nov 2012 16:39:05 +0000 (09:39 -0700)]
Properly check for presence of old bucardo_sequences table.

`$count` will be true if it exists, and false if it does not. The issue was
not to do with `execute()`, as I originally thought; @machack666 was right
about that. Resolves #31.

12 years agoRequire Pod::Usage and List::Util at runtime.
David E. Wheeler [Fri, 2 Nov 2012 00:33:27 +0000 (17:33 -0700)]
Require Pod::Usage and List::Util at runtime.

12 years agoFix some issues with `add sequnce`.
David E. Wheeler [Fri, 2 Nov 2012 00:16:32 +0000 (17:16 -0700)]
Fix some issues with `add sequnce`.

12 years agoFix `list_sequences()`.
David E. Wheeler [Fri, 2 Nov 2012 00:02:40 +0000 (17:02 -0700)]
Fix `list_sequences()`.

12 years agoUpdate Changes since 4.99.5.
David E. Wheeler [Thu, 1 Nov 2012 23:44:48 +0000 (16:44 -0700)]
Update Changes since 4.99.5.

12 years agoRequire List::Util and Pod::Usage in the spec file.
David E. Wheeler [Thu, 1 Nov 2012 23:13:05 +0000 (16:13 -0700)]
Require List::Util and Pod::Usage in the spec file.

12 years agoShow both users if try to connect as "postgres" and "bucardo".
David E. Wheeler [Thu, 1 Nov 2012 23:07:11 +0000 (16:07 -0700)]
Show both users if try to connect as "postgres" and "bucardo".

Took me an hour to chase down a bad login because I kept telling it to use
user bucardo and it said it could not connect as user "postgres". It was only
when I dug deep enough that I discovered that it was sneakily changing the
username on me. So let's just show both user in the error message.

12 years agoUse lexical subs, not globals.
David E. Wheeler [Thu, 1 Nov 2012 22:41:57 +0000 (15:41 -0700)]
Use lexical subs, not globals.

Globals are not a very safe thing to use, as they persist beyond the execution
of the function in the global namespace. There is simply no need for that kind
of pollution and leakage.

12 years agoForgot to rename some standard_conflict columns.
David E. Wheeler [Thu, 1 Nov 2012 22:35:13 +0000 (15:35 -0700)]
Forgot to rename some standard_conflict columns.

No idea why tests were not failing.

12 years agoEliminate remaining `goto`s from PL/Perl.
David E. Wheeler [Thu, 1 Nov 2012 22:28:47 +0000 (15:28 -0700)]
Eliminate remaining `goto`s from PL/Perl.

The use of "goto" to jump into a construct has been deprecated since Perl
5.12. No need to fill up logs with the deprecation warning when there are
much cleaner way to do conditionals.

This patch is bigger than it looks: most changes are indentation. Run `git
diff -w` to see what it really looks like.

12 years agoEliminate `goto KICKFUNC`.
David E. Wheeler [Thu, 1 Nov 2012 22:14:21 +0000 (15:14 -0700)]
Eliminate `goto KICKFUNC`.

12 years agoUpdate init script and RPM patch.
David E. Wheeler [Thu, 1 Nov 2012 21:58:28 +0000 (14:58 -0700)]
Update init script and RPM patch.

12 years agoSleep for 0.5s after serialization failure.
David E. Wheeler [Thu, 1 Nov 2012 21:54:39 +0000 (14:54 -0700)]
Sleep for 0.5s after serialization failure.

By default, and rather than the previous 10s time. Kevin Gritter tells us that
we could probably eliminate the sleep, as the chances of a conflict after a
serialization rollback are extremely low. Even 20ms would be generous, he
says. Going with 0.5s (500 ms) just because it's the same value as the default
`kid_sleep`.

12 years agoTweak formatting of config settings in Pod.
David E. Wheeler [Thu, 1 Nov 2012 21:26:22 +0000 (14:26 -0700)]
Tweak formatting of config settings in Pod.

12 years agoReplace --debug options with --log options.
David E. Wheeler [Thu, 1 Nov 2012 20:37:18 +0000 (13:37 -0700)]
Replace --debug options with --log options.

`--debugdir`, `--debugsyslog`, and `--debugfile` have all been folded into
`--debug-destination`. This option may be specified multiple times, with the
values "syslog", "stderr", "stdout", "none", or a directory name. This means
you can log to a directory, syslog, and STDERR all at the same time if you
like. The old options are still around in name, but their values are used only
if `--log-destination` is not, and then they are adapted to it.

Implementation-wise, there is now a new method, _logto(), that returns a list
of code references, one for each destination. glog() simply passes the log
header and message to each code reference in turn. _logto() also notices when
the process has been forked and creates new code refernces as appropriate.
This is especially important when --log-separate is specified. If
--log-destination is passed "none", there will be no logging at all (even if
there are other calls to log-destination).

Relatedly:
* `--debugfilesep` has been renamed to `--log-separate`.
* `--debugname` has been renamed to `--log-extension`.
* `--cleandebugs` has been renamed to `log-clean`.
* If there are "stderr" or "stdout" destinations, the corrsponding file
  handles are no longer closed once the MCP forks.
* Logging to the warning file no longer happens when the string "Warning"
  appears in the log message, but when th elog leve is LOG_WARN.