Greg Sabino Mullane [Tue, 12 Nov 2013 18:14:36 +0000 (13:14 -0500)]
Signature for 4.99.9
Greg Sabino Mullane [Tue, 12 Nov 2013 18:13:01 +0000 (13:13 -0500)]
Version 4.99.9
Greg Sabino Mullane [Tue, 12 Nov 2013 17:59:27 +0000 (12:59 -0500)]
Fix quoting for inserts to the bucardo_deltanames table in validate_sync.
Greg Sabino Mullane [Tue, 12 Nov 2013 05:16:54 +0000 (00:16 -0500)]
Initialize var
Greg Sabino Mullane [Tue, 12 Nov 2013 05:15:23 +0000 (00:15 -0500)]
Fixes for the new bucardo_delta_names table.
Greg Sabino Mullane [Tue, 12 Nov 2013 05:02:33 +0000 (00:02 -0500)]
Make sure we specify schema
Greg Sabino Mullane [Tue, 12 Nov 2013 04:39:38 +0000 (23:39 -0500)]
Always check pg_async_status before calling pg_cancel
Greg Sabino Mullane [Tue, 12 Nov 2013 04:20:57 +0000 (23:20 -0500)]
Stupid tabs
Greg Sabino Mullane [Tue, 12 Nov 2013 04:19:59 +0000 (23:19 -0500)]
Make sure we only try to populate bucardo_delta_names for source databases.
Greg Sabino Mullane [Sat, 9 Nov 2013 19:31:24 +0000 (14:31 -0500)]
On FK warnings, show the contraint name, otherwise we often have duplicated we cannot distinguish.
Greg Sabino Mullane [Sat, 9 Nov 2013 18:18:46 +0000 (13:18 -0500)]
Show the host in our connection logging if we have one.
Greg Sabino Mullane [Sat, 9 Nov 2013 18:10:40 +0000 (13:10 -0500)]
Testing putting a pg_cancel at the end of the kid before the rollback.
Greg Sabino Mullane [Sat, 9 Nov 2013 18:06:57 +0000 (13:06 -0500)]
Don't show the initial DSN to the Bucardo database
Greg Sabino Mullane [Fri, 8 Nov 2013 19:41:35 +0000 (14:41 -0500)]
We don't need to check database wide when we already check database/table combo anyway.
Greg Sabino Mullane [Fri, 8 Nov 2013 04:53:09 +0000 (23:53 -0500)]
Introduce the concept of a "quick delta" check.
By default, this is turned on, but is left as a config variable in case this turns out to be a very bad idea. :)
This is a huge win on slow networks. Rather than getting a distinct pk count for every table in the sync, we ask the remote
database for a list of all tables and whether or not they have any changes. If they don't, we do not have to bother
with the normal "select distinct" query. This reduces the number of database calls drastically for syncs with a
large number of tables. In addition, the delta quick queries inside the function are extraorfinarily fast compared
to their distinct counterparts, as they do a select 1 ... limit 1.
All of this is accomplished by a new table on each source database called bucardo_delta_names, which stores a
list of all tables for a sync, along with their delta and track table names. This table's information is rewritten
on Bucardo startup each time. The new function uses this table to dynamically generate the quick delta queries
for each table, and then returns it in a simple text format.
This is especially noticeable on slow networks with a large number of tables in a sync. Testing in the case
that drove all this improved the sync run speed from 42 seconds to less than a second (for no rows - the
number of rows is a constant cost limited by how fast COPY goes, in most cases).
Greg Sabino Mullane [Wed, 6 Nov 2013 16:56:55 +0000 (11:56 -0500)]
Let's try this again...
Greg Sabino Mullane [Wed, 6 Nov 2013 16:55:15 +0000 (11:55 -0500)]
Typo.
Greg Sabino Mullane [Tue, 5 Nov 2013 23:20:31 +0000 (18:20 -0500)]
Show chunk when copying
Greg Sabino Mullane [Tue, 5 Nov 2013 20:31:13 +0000 (15:31 -0500)]
Change default statement_chunk_size from 10000 to 8000, based on real-world experience.
Greg Sabino Mullane [Tue, 5 Nov 2013 16:47:29 +0000 (11:47 -0500)]
Use prepare_cached, not prepare, inside of fetch1_sql
Greg Sabino Mullane [Tue, 5 Nov 2013 16:18:30 +0000 (11:18 -0500)]
Typo: compress_delta is a function, not a table
Greg Sabino Mullane [Tue, 29 Oct 2013 04:37:13 +0000 (00:37 -0400)]
Cache the column lookups inside of validate_sync.
Greg Sabino Mullane [Fri, 25 Oct 2013 03:12:12 +0000 (23:12 -0400)]
Make sure we do something sensible if we call for a log_level before we have loaded the config.
Greg Sabino Mullane [Thu, 24 Oct 2013 03:36:59 +0000 (23:36 -0400)]
Tabs cleanup
Greg Sabino Mullane [Thu, 24 Oct 2013 03:35:29 +0000 (23:35 -0400)]
Replace 'haztrig' with cached version inside of validate_sync.
Greg Sabino Mullane [Thu, 24 Oct 2013 02:38:56 +0000 (22:38 -0400)]
Show the DSN we are connecting with
Greg Sabino Mullane [Wed, 23 Oct 2013 14:58:49 +0000 (10:58 -0400)]
Report on total sync time in the logs, even if no rows were changed.
Greg Sabino Mullane [Wed, 23 Oct 2013 03:38:26 +0000 (23:38 -0400)]
Only try and create that index once.
Greg Sabino Mullane [Wed, 23 Oct 2013 03:29:22 +0000 (23:29 -0400)]
Speed up the initial validate sync quite a bit by pre-loading all the table, index, and function existence information.
Greg Sabino Mullane [Wed, 23 Oct 2013 02:16:06 +0000 (22:16 -0400)]
No longer use the whole prefix when building the listen/notify strings, as it may contain a syncname now.
Greg Sabino Mullane [Sun, 20 Oct 2013 02:10:32 +0000 (22:10 -0400)]
When doing `bucardo list databases`, don't show the psql port connection param unless it is set to something.
Greg Sabino Mullane [Sat, 19 Oct 2013 01:41:56 +0000 (21:41 -0400)]
Fix wrong search before inserting to bucardo_delta_targets.
This would explain the large number of rows seen in that table in the wild!
Greg Sabino Mullane [Fri, 18 Oct 2013 04:12:02 +0000 (00:12 -0400)]
Expand the arrays in the opening config dump in the logs.
Greg Sabino Mullane [Fri, 18 Oct 2013 03:41:20 +0000 (23:41 -0400)]
Enforce sane isolation levels
Greg Sabino Mullane [Fri, 18 Oct 2013 02:42:28 +0000 (22:42 -0400)]
Add new config 'log_showsyncname', defaulting to 1 (on), which will show the name of the current sync in parens after the 'KID' in the log output.
So rather than this:
(29985) [Thu Oct 17 22:40:12.885 2013] KID Database "A" backend PID: 29987
You will see this:
(29985) [Thu Oct 17 22:40:12.885 2013] KID (fctest) Database "A" backend PID: 29987
As suggested by Michelle Sullivan on the mailing list.
Greg Sabino Mullane [Fri, 18 Oct 2013 02:30:52 +0000 (22:30 -0400)]
Typo.
Greg Sabino Mullane [Thu, 17 Oct 2013 03:12:42 +0000 (23:12 -0400)]
Update versions in html docs
Greg Sabino Mullane [Thu, 17 Oct 2013 03:10:44 +0000 (23:10 -0400)]
Fix some pod
Greg Sabino Mullane [Thu, 17 Oct 2013 02:59:57 +0000 (22:59 -0400)]
Don't remember why this was here, but mark it as LOG_DEBUG
Greg Sabino Mullane [Thu, 17 Oct 2013 02:58:51 +0000 (22:58 -0400)]
Away with ye, tab
David E. Wheeler [Wed, 16 Oct 2013 21:25:07 +0000 (14:25 -0700)]
Set version to 4.99.8.
David E. Wheeler [Wed, 16 Oct 2013 20:39:09 +0000 (13:39 -0700)]
Try harder to collect and emit errors on validation failures.
There's no need to wait for a NOTIFY, as `validate_sync()` runs synchronously.
So just check the return value for errors, and use excpetion handling to catch
other kinds of errors. This allows us to catch and emit all errors and also
allow execution to finish validating all syncs (should it be validating
multiples). Closes #65.
David E. Wheeler [Tue, 15 Oct 2013 23:35:57 +0000 (16:35 -0700)]
Improve the auto-creation of the "bucardo" role.
When adding a database, that is. The old code led to confusing errors, where
the user would be told that Bucardo failed to connect as user "postgres" when
you had not, in fact, asked it to. So log more informat as it goes along,
noting failure to connect as "bucardo", trying to connect as "postgres", and
showing success or failure at doing so. This makes things much clearer to the
user what's going on -- and is less fussy, to boot.
Resolves #63.
Greg Sabino Mullane [Tue, 15 Oct 2013 00:56:56 +0000 (20:56 -0400)]
More bypassing of track_rates
Greg Sabino Mullane [Tue, 15 Oct 2013 00:55:05 +0000 (20:55 -0400)]
Skip the not-working-now track_rates section.
Joshua Tolley [Mon, 14 Oct 2013 14:52:23 +0000 (08:52 -0600)]
Merge in patch to ensure objects from different databases but having the same
names are treated distinctly.
David E. Wheeler [Mon, 7 Oct 2013 18:45:39 +0000 (11:45 -0700)]
Log verbose instead of debug.
For serialization and deadlock failures.
David E. Wheeler [Mon, 7 Oct 2013 16:56:06 +0000 (09:56 -0700)]
Log loglevel as a string.
David E. Wheeler [Mon, 7 Oct 2013 16:23:07 +0000 (09:23 -0700)]
Make it clearer which handles to log.
David E. Wheeler [Mon, 7 Oct 2013 16:21:55 +0000 (09:21 -0700)]
Topic, not lexical.
David E. Wheeler [Mon, 7 Oct 2013 16:20:29 +0000 (09:20 -0700)]
Log only errors.
Greg Sabino Mullane [Sat, 5 Oct 2013 01:19:27 +0000 (21:19 -0400)]
Try harder to find initdb when testing.
Greg Sabino Mullane [Sat, 5 Oct 2013 01:19:03 +0000 (21:19 -0400)]
Add some text fields to the dbgroup and herd tables for future use in "cloning"
Greg Sabino Mullane [Fri, 4 Oct 2013 14:30:44 +0000 (10:30 -0400)]
Make the inactivate sub a bit smarter. May fix the recurring doublefree/coredump VAC issue.
David E. Wheeler [Wed, 2 Oct 2013 23:43:27 +0000 (16:43 -0700)]
Fix inaccurate comment.
David E. Wheeler [Wed, 2 Oct 2013 22:34:22 +0000 (15:34 -0700)]
Changing a sync status does not load or unload it.
So document that fact. We may or may not want to change this in the future.
Ref #55.
David E. Wheeler [Wed, 2 Oct 2013 22:29:07 +0000 (15:29 -0700)]
Update sync status on activate/deactivate.
Resolves #55.
David E. Wheeler [Wed, 2 Oct 2013 21:57:50 +0000 (14:57 -0700)]
Document strict_checking for tables, too.
Allow it to be passed to `add table` as well as `update table`.
Ref #57.
David E. Wheeler [Wed, 2 Oct 2013 21:51:23 +0000 (14:51 -0700)]
Document strict_checking and add it to `add sync`.
Resolves #57.
David E. Wheeler [Wed, 2 Oct 2013 18:41:07 +0000 (11:41 -0700)]
Add the reload_config_timeout config.
And put it to use in the reload_config command. Also provide more context in
the error message when it does timeout. Closes #67.
David E. Wheeler [Wed, 2 Oct 2013 18:25:34 +0000 (11:25 -0700)]
Change default reload_config timeout to 30s.
Ref #67.
David E. Wheeler [Wed, 2 Oct 2013 16:25:39 +0000 (09:25 -0700)]
Purge unknown tables from bucardo_delta_targets.
They seem to get left behind when a table is dropped. Maybe other reasons,
I honestly don't know.
Greg Sabino Mullane [Wed, 11 Sep 2013 15:41:27 +0000 (11:41 -0400)]
Don't show serialize/deadlock errors unless we are LOG_VERBOSE, per mailing list discussion.
Greg Sabino Mullane [Thu, 29 Aug 2013 02:45:55 +0000 (22:45 -0400)]
Switch time zone to GMT, as we did in Bucardo4
David E. Wheeler [Thu, 25 Jul 2013 15:33:03 +0000 (17:33 +0200)]
In `status`, if last run is "empty", call it "good".
Two reasons for this:
* An empty run is not a failure, but "Empty" is kind of distracting
in the output.
* It is useful, if you just kicked a sync, to see that it ran in the output of
`status`, even if it was empty.
David E. Wheeler [Thu, 25 Jul 2013 14:57:54 +0000 (16:57 +0200)]
State can also be "Unknown".
Though I am not sure how it gets in that state...
David E. Wheeler [Thu, 25 Jul 2013 14:55:16 +0000 (16:55 +0200)]
Note state value for currently-running sync.
David E. Wheeler [Thu, 25 Jul 2013 14:40:05 +0000 (16:40 +0200)]
End syncs on deadlock and serialization failure.
When I added the serialization failure-handling code, I neglected to notice
that it left orphaned `syncrun` rows with no `ended` value. This confused
later syncruns -- like the one that would run after the 0.5s sleep after a
serialization failure. The code was rolling back the main (Bucardo) database
connection, but the syncrun was already committed elsewhere (so that other
processes could see that a sync is in progress, of course; duh!).
So modify the code to instead call `end_syncrun()` and declare the sync
failed, but, of course, with a status recording the seriazliation failure or
deadlock.
David E. Wheeler [Wed, 24 Jul 2013 17:45:50 +0000 (19:45 +0200)]
Listen for autokicks on sources for the sync, not all sources.
I had a database in two dbgroups (and syncs), once as a target and once as a
source. On startup, `validate_sync()` was processing the sync where it was a
target, first, and that was the role saved for it in `$self->{sdb}`. Then,
when `validate_sync()` iterated over `$self->{sdb}`, it thought it was a role,
and so did not have the MCP listen for kicks.
Not only that, but sources from other, previously-validated syncs were
unnecessarily listening for kicks!
So change the code to iterate over the list of DBs for the current call to
`validate_sync()`, not all dbs for all syncs, when figuring out whereq to listen
to for kicks.
Note that the use of the same db object in multiple db groups and syncs *may*
cause issues in other places. It would be smart to audit all code that checks
the value in `{role}` for each hash in `$self->{sdb}` and figure out if it is
appropriate. Since the same db can have different roles in differnt syncs, it
might make sense to record all of its roles and to check all of them, rather
than just rely on the first role found.
David E. Wheeler [Wed, 24 Jul 2013 17:23:16 +0000 (19:23 +0200)]
Revert "Make kick triggers consistently use the non-payload version."
This reverts commit
25973f4b5ba797568467632b79e8129ffe007f49. I'm pretty sure
this was not the problem, since I have syncs that *do* work with this
approach.
The problem I'm having with a NOTIFY being ignored is that the database in
question is used in two db groups, once as a source, another as a target. As
it validates, it finds the target record before the source, and stores that
one away. Then the autokick is ignored, because Bucardo thinks the DB is a
target, not a source. Working on a fix for that now.
David E. Wheeler [Wed, 24 Jul 2013 16:16:22 +0000 (18:16 +0200)]
Check for empty state, too.
David E. Wheeler [Wed, 24 Jul 2013 16:16:04 +0000 (18:16 +0200)]
Remove listen_payload in unlisten_all().
David E. Wheeler [Wed, 24 Jul 2013 16:15:44 +0000 (18:15 +0200)]
Add daemon role to application name.
Greg Sabino Mullane [Wed, 24 Jul 2013 14:46:47 +0000 (10:46 -0400)]
Make kick triggers consistently use the non-payload version.
May want to have MCP be able to recognize both versions for backwards compat.
David E. Wheeler [Tue, 23 Jul 2013 22:46:14 +0000 (00:46 +0200)]
Fix `reload config` timeout.
First, allow `reload config 30` to work. Resolves #66.
Second, actually *capture* the timeout and wait that long, instead of just
five seconds every time.
Greg Sabino Mullane [Thu, 18 Jul 2013 02:48:37 +0000 (22:48 -0400)]
Remove comment line about spacing - no longer applies.
Greg Sabino Mullane [Thu, 18 Jul 2013 02:44:45 +0000 (22:44 -0400)]
Make sure "bucardo help" doesn't try to connect to a database. Per github issue #64
Greg Sabino Mullane [Mon, 1 Jul 2013 16:00:43 +0000 (12:00 -0400)]
Bump the version to 5.0.0.
Greg Sabino Mullane [Fri, 28 Jun 2013 17:06:59 +0000 (13:06 -0400)]
Switch default isolation level back to repeatable read
Greg Sabino Mullane [Fri, 21 Jun 2013 03:40:29 +0000 (23:40 -0400)]
Match process name case-insensitive
Greg Sabino Mullane [Fri, 21 Jun 2013 02:33:01 +0000 (22:33 -0400)]
Proper debug for isolation levels
Greg Sabino Mullane [Mon, 17 Jun 2013 03:45:11 +0000 (23:45 -0400)]
Fixes for upgrade magic
Greg Sabino Mullane [Wed, 29 May 2013 17:15:28 +0000 (13:15 -0400)]
Let's do github canonically
Greg Sabino Mullane [Mon, 27 May 2013 12:26:04 +0000 (08:26 -0400)]
Move some things from bugzilla to here
Greg Sabino Mullane [Sat, 18 May 2013 04:43:18 +0000 (00:43 -0400)]
Super minor tweak
Greg Sabino Mullane [Sat, 4 May 2013 15:19:28 +0000 (11:19 -0400)]
VAC handle pg_listener, per list discussion
Joshua Tolley [Wed, 24 Apr 2013 15:15:18 +0000 (09:15 -0600)]
This should have gone in with the last commit, as well
Joshua Tolley [Wed, 24 Apr 2013 15:14:48 +0000 (09:14 -0600)]
Improve output, and update tests accordingly
Joshua Tolley [Tue, 23 Apr 2013 16:09:35 +0000 (10:09 -0600)]
Add a bit more output to identify a database
Joshua Tolley [Tue, 23 Apr 2013 16:06:00 +0000 (10:06 -0600)]
Add tests and code for update table db filtering
Joshua Tolley [Tue, 23 Apr 2013 15:51:25 +0000 (09:51 -0600)]
Clean up lots, and get list table working better
Joshua Tolley [Tue, 23 Apr 2013 15:46:16 +0000 (09:46 -0600)]
Clean up tests
Joshua Tolley [Mon, 22 Apr 2013 22:11:59 +0000 (16:11 -0600)]
Merge branch 'master' of ssh://bucardo.org/var/lib/git/bucardo into database-specific-names
Joshua Tolley [Mon, 22 Apr 2013 22:11:25 +0000 (16:11 -0600)]
Fix customcols; all preexisting tests pass
Joshua Tolley [Mon, 22 Apr 2013 21:50:08 +0000 (15:50 -0600)]
even more tests work now
Joshua Tolley [Mon, 22 Apr 2013 19:49:07 +0000 (13:49 -0600)]
Fix herd adding logic, with caveats noted in test source
Joshua Tolley [Mon, 22 Apr 2013 16:01:20 +0000 (10:01 -0600)]
Consolidate methods for finding goats
Greg Sabino Mullane [Wed, 17 Apr 2013 16:03:17 +0000 (12:03 -0400)]
Allow for auto reconnection of databases for crash testing.
Joshua Tolley [Wed, 17 Apr 2013 15:35:25 +0000 (09:35 -0600)]
Typo
Joshua Tolley [Tue, 16 Apr 2013 20:16:53 +0000 (14:16 -0600)]
Merge from master