David E. Wheeler [Wed, 24 Oct 2012 23:54:46 +0000 (16:54 -0700)]
Update the RPM support files.
Includes a patch that puts all the log files into /var/log/bucardo by default.
David E. Wheeler [Wed, 24 Oct 2012 23:52:14 +0000 (16:52 -0700)]
Move distribution-supporting scripts to `dist`.
David E. Wheeler [Wed, 24 Oct 2012 22:31:21 +0000 (15:31 -0700)]
Fix test failure introduced in
f77fdbfd88b8.
BucardoTesting now throws an exception on `qx()` failure, and prepends its own
info to the returned message.
David E. Wheeler [Wed, 24 Oct 2012 22:28:44 +0000 (15:28 -0700)]
Remove redundant LISTEN.
The value of `"bucardo_syncdone_$sync"` is exactly the same as the `"$done"`
two lines before. And `$s` was unused.
David E. Wheeler [Wed, 24 Oct 2012 22:26:10 +0000 (15:26 -0700)]
Test all return values of `ctl()` in postgres tests.
I am still getting test failures, but they are less noisy now that I have it
die after a `sync` fails. The current reason for the failures is that the call
to `goto KID` added in
ea4923155f comes before the definition of the KID
label.
In passing, make it clearer that BucardoTesting forces a timeout even when you
pass a `0` to `ctl()`.
David E. Wheeler [Wed, 24 Oct 2012 21:16:49 +0000 (14:16 -0700)]
Work around missing database handles.
This was causing tests to fail, because the KID was choking on something, and
so cleaning up, closing all database handles, but some were simply not there.
So add code to notice this condition and log a warning.
Unknown is why this happens in the first place. Bug?
David E. Wheeler [Wed, 24 Oct 2012 18:22:40 +0000 (11:22 -0700)]
Update test count.
David E. Wheeler [Wed, 24 Oct 2012 18:22:10 +0000 (11:22 -0700)]
Don't activate msync.
It makes the tests BAIL OUT.
David E. Wheeler [Wed, 24 Oct 2012 18:19:10 +0000 (11:19 -0700)]
Fix exit value of `update` command.
It was calling `exit 1` on sucess, because it expected the various `update_*`
functions to return booleans. They don't. It looks like they return undef on
success and `exit` themselves on failure.
So change the code to only exit with failure if the thing we're asked
to update is unknown. Ottherwise, call the proper `update_*` function
and `exit 0`.
Discovered by changing the `ctl` test method die if `qx()` exits abnormally
and starting to check the return value of `ctl` more often.
David E. Wheeler [Wed, 24 Oct 2012 18:18:46 +0000 (11:18 -0700)]
Fix invalid sync activation.
It was trying to start a sync named "mtest", and there is no such sync.
So test the return value of `ctl()` there and fix it.
This, BTW, causes the tests to completely bail out. Maybe msync should
not be activated?
Greg Sabino Mullane [Wed, 24 Oct 2012 03:48:59 +0000 (23:48 -0400)]
Quick implementation of the retry on serialization plan laid on on the mailing list.
Greg Sabino Mullane [Wed, 24 Oct 2012 03:40:52 +0000 (23:40 -0400)]
It is possible (although very dumb) to set kid_serial_sleep to 0, so base our decision on definededness not == 0.
Greg Sabino Mullane [Wed, 24 Oct 2012 03:39:16 +0000 (23:39 -0400)]
When scanning for errors, no need to keep scanning once we find an interesting one (deadlock or serialization) because there can be only one such.
David E. Wheeler [Mon, 22 Oct 2012 23:07:22 +0000 (16:07 -0700)]
Sleep less; report errors.
I sometimes deleted the test data directories without shutting down pg. I
would then get failures about not being able to find the postgresql.conf file.
Why? Because I was out of shared memory, so the initdb failed. But there were
no initdb errrors. So the `die $res if $? != 0;` line shows those failures.
Meanwhile, working on trying to figure out serialization failures, it seems
silly for it to sleep 10s while testing, so have it sleep for just 1s.
David E. Wheeler [Mon, 22 Oct 2012 21:23:41 +0000 (14:23 -0700)]
Remove arg specifier.
David E. Wheeler [Mon, 22 Oct 2012 21:16:13 +0000 (14:16 -0700)]
Silence warning about active statement handles.
By calling `finish()` on them.
David E. Wheeler [Mon, 22 Oct 2012 19:03:50 +0000 (12:03 -0700)]
Don't die when Postgres is down.
Noticed during tests that sometimes when the `t/20-postgres.t` tests failed,
the `bucardo.mcp.pid` file was left in place. Even though the MCP was gone.
This prevented subsequent tests from running, as they couldn't start the MCP
(Bucardo thought it was still running, because the PID file was still there).
Looking through the log, I noticed that the connection to the database was
dying in `cleanup_mcp()`. Not sure why, but the log said:
(78512) [Mon Oct 22 12:01:17.638 2012] #0578 MCP Warning: Killed (line 6722): DBD::Pg::db selectcol_arrayref failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request. at /Users/david/dev/postgresql/bucardo/blib/lib/Bucardo.pm line 6722.
That was dying, and the subsequent lines that actually delete the PID file
were therefore never run.
This commit wraps the call to the database in an `eval{}`. If it dies, the
database shutdown time is set to "unknown". We skip further database
interactions when the time is unknown. This allows the shutdown to continue
without exiting, and the MCP PID file gets cleaned up.
Resolves #26.
David E. Wheeler [Sat, 20 Oct 2012 00:11:45 +0000 (17:11 -0700)]
Don't start bucardo when no syncs while testing.
This seems to prevent an error where Bucardo won't start, even though it
waited. I suspect this is becaust earlier tests run that start Bucardo with no
syncs and don't bother to stop it again, because they expect it to exit, as it
did prior to
cc92a976e00df6a5182745b47793b44401e6b336.
Also, don't shut down Postgres on test exit. It just seems to confuse things.
David E. Wheeler [Fri, 19 Oct 2012 18:53:50 +0000 (11:53 -0700)]
Shut down on END instead of DESTROY.
David E. Wheeler [Fri, 19 Oct 2012 01:50:54 +0000 (18:50 -0700)]
Take the hint and shutdown fast.
Fast mode does not wait for clients to disconnect, which is what we want.
David E. Wheeler [Fri, 19 Oct 2012 01:34:39 +0000 (18:34 -0700)]
Try hader to shut down Postgres.
Use `pg_ctl stop`, as it seems to be more reliable: I kept seeing postgres
processes running after the tests exited. Also, add a DESTROY to be sure to
shut them all down before exiting.
David E. Wheeler [Fri, 19 Oct 2012 00:38:18 +0000 (17:38 -0700)]
Update `show_why_sync_killed()`.
At least I think so. It was still querying `bucardo.q`, which was removed in
0763c281. I replaced its calls with the columns that look more or less
parallel, although `pid` is gone. A review would be appreciated.
I got errors about it not working while running failing tests. Still trying to
chase down the underlying failures...
David E. Wheeler [Thu, 18 Oct 2012 23:36:20 +0000 (16:36 -0700)]
Revert moving the start file to the debug dir.
Was moved in
56ea2b2b4b0ec63383a32e8c886439a451b88929. But this turned out to
confuse things, such that tests were unable to shut down Bucardo, because the
server and the client had a different idea where the file belongs. This is
most likely the reason I was seeing stop failures as reported in GitHub
Issue #11.
Now that I understand that its location can be set via `bucardo set
reason_file`, I am just documenting that.
David E. Wheeler [Thu, 18 Oct 2012 22:58:34 +0000 (15:58 -0700)]
Ignore bucardo.restart.reason.*.
David E. Wheeler [Thu, 18 Oct 2012 19:29:49 +0000 (12:29 -0700)]
Priority currently used only for display.
David E. Wheeler [Thu, 18 Oct 2012 19:28:27 +0000 (12:28 -0700)]
Document `checktime`.
David E. Wheeler [Thu, 18 Oct 2012 19:25:22 +0000 (12:25 -0700)]
Document `overdue`.
David E. Wheeler [Thu, 18 Oct 2012 18:55:33 +0000 (11:55 -0700)]
Mention GitHub issues, link to Mail list.
David E. Wheeler [Thu, 18 Oct 2012 18:46:38 +0000 (11:46 -0700)]
Remove `limitdbs`.
Was only in 5.0 betas, but I added drop column support to `upgrade()`, anyway.
Works nicely.
David E. Wheeler [Thu, 18 Oct 2012 00:37:58 +0000 (17:37 -0700)]
Document aliases.
David E. Wheeler [Thu, 18 Oct 2012 00:34:51 +0000 (17:34 -0700)]
Finish basic documentation of all commands.
David E. Wheeler [Thu, 18 Oct 2012 00:19:00 +0000 (17:19 -0700)]
Some more commands implemented:
* restart
* message
* reload
* update
Plus fixed the synopses for activate and deactivate, and listed the possible values for
the standard_conflict parameter.
David E. Wheeler [Wed, 17 Oct 2012 23:47:19 +0000 (16:47 -0700)]
Done editing existing commands.
David E. Wheeler [Wed, 17 Oct 2012 23:34:02 +0000 (16:34 -0700)]
Document `remove` and update `reload config`.
David E. Wheeler [Wed, 17 Oct 2012 23:06:10 +0000 (16:06 -0700)]
Document adding `customname`, `customcols`, and `customcode`.
Had to do quite a bit of Googling and code archaeology to figure these out.
Hope they're correct. Corrections appreciated, especially for `customcode`,
which seems to be woefully underdocumented up to now.
David E. Wheeler [Wed, 17 Oct 2012 21:49:50 +0000 (14:49 -0700)]
Document `add herd` and `add sync`.
Quite a few questions about some of the parameters to `add sync`, demarcated by `XXX`s.
While at it, add a brief intro discussing options and parameters.
David E. Wheeler [Wed, 17 Oct 2012 19:39:37 +0000 (12:39 -0700)]
Update docs on adding tables and seuences.
David E. Wheeler [Wed, 17 Oct 2012 18:58:41 +0000 (11:58 -0700)]
Start filling out gaps in the docs.
And correcting apparent inaccuracies and modernizing the Pod a bit. This
commit Updates docs through `add db`. Notable changes:
* Remove the bit in the `start` docs about how it restarts Bucardo. The code
does not appear to support that, and the `restart` command seems to have it
covered.
* Remove the "--name" bit from the `start` and `stop` commands. There is no
`--name` option, so I just found it confusing.
* Itemize the types supported by `list` in a Pod list.
* Itemize all the objects supported by `add`.
* Itemize all of the options to `add db`.
Proof-reading for inaccuracie would be greatly appreciated.
David E. Wheeler [Wed, 17 Oct 2012 17:59:42 +0000 (10:59 -0700)]
Stub missing commands in docs.
David E. Wheeler [Wed, 17 Oct 2012 00:02:40 +0000 (17:02 -0700)]
The verb is now split from the noun at line 219.
David E. Wheeler [Tue, 16 Oct 2012 23:47:00 +0000 (16:47 -0700)]
Change default reason_file name to end in .txt.
Because it is not a log file, only the most reason reason is written
to it.
But also modify the rason log file to replace the extension from the reason
file with `.log`. So it should no longer be named
`bucardo.restart.reason.log.log` by default.
In other words, the names are:
Reason File: `bucardo.restart.reason.txt`
Rason Log: `bucardo.restart.reason.log`.
Closes GitHub issue #9.
David E. Wheeler [Tue, 16 Oct 2012 23:30:12 +0000 (16:30 -0700)]
Move the reason file to the debug directory.
Which is `.` by default, so in the default case, it will be the same as the
current behavior. Ref: GitHub Issue #9.
David E. Wheeler [Tue, 16 Oct 2012 23:18:01 +0000 (16:18 -0700)]
Skip the .init and .spec files.
They are not Perl. Maybe distribution-related stuff should go into another directory? `dist` perhaps?
David E. Wheeler [Tue, 16 Oct 2012 23:11:55 +0000 (16:11 -0700)]
Add --exit-on-nosync option.
And change the default so that, if there are no active syncs, by default
bucardo will *not* exit. Pass this option to make it exit anyway. Per
discussion; Closes #8
David E. Wheeler [Tue, 16 Oct 2012 22:51:09 +0000 (15:51 -0700)]
Move all but two blocker to-dos to GitHub issues.
They are still here, but now with links to GitHub. Could not find the post reporting the bug that checks the wrong tables, so I did not add that one. The other one I did not add was answering all mail list messages.
David E. Wheeler [Tue, 2 Oct 2012 22:08:21 +0000 (15:08 -0700)]
Add a Linux init script and RPM spec file.
The latter is forked from Devrim's pgrpms spec file.
David E. Wheeler [Mon, 1 Oct 2012 22:59:43 +0000 (15:59 -0700)]
Add chkconfig support to the start script.
Greg Sabino Mullane [Sun, 30 Sep 2012 03:50:10 +0000 (23:50 -0400)]
Clean up TODO, add some links.
Greg Sabino Mullane [Sat, 29 Sep 2012 03:02:25 +0000 (23:02 -0400)]
Workarounds for empty primary key join/split problem found by Bill on mailing list.
Greg Sabino Mullane [Sat, 29 Sep 2012 03:01:39 +0000 (23:01 -0400)]
Remove debug detritus.
Greg Sabino Mullane [Thu, 27 Sep 2012 13:03:59 +0000 (09:03 -0400)]
Change PGIN to IN; consolidate flat and flatpg modes for now.
Rosser Schwarz [Thu, 27 Sep 2012 07:04:00 +0000 (00:04 -0700)]
and another.
Rosser Schwarz [Thu, 27 Sep 2012 07:02:50 +0000 (00:02 -0700)]
oops. missed a spot.
Rosser Schwarz [Wed, 26 Sep 2012 04:25:24 +0000 (21:25 -0700)]
consolidating IN and PGIN blocks in delete_rows
Greg Sabino Mullane [Wed, 26 Sep 2012 03:45:37 +0000 (23:45 -0400)]
Prevent empty trailing items from being ignored when doing a split, especially for the list of primary keys. This should fix a problem reported on the mailing list giving the error "arguments of row IN must all be row expressions"
Greg Sabino Mullane [Fri, 21 Sep 2012 20:45:28 +0000 (16:45 -0400)]
Quick TODO additions
Greg Sabino Mullane [Fri, 21 Sep 2012 20:15:34 +0000 (16:15 -0400)]
Since we use MAX(), and the table may have no rows, we need to handle getting back a null, which means that $epoch may be undefined.
Greg Sabino Mullane [Thu, 20 Sep 2012 20:38:44 +0000 (16:38 -0400)]
Fix some syntax and other problems; simple tests now show 8.1 works as a valid target database.
Greg Sabino Mullane [Thu, 20 Sep 2012 20:27:37 +0000 (16:27 -0400)]
Force time zone to uppercase GMT for old servers.
Greg Sabino Mullane [Fri, 14 Sep 2012 17:29:31 +0000 (13:29 -0400)]
Check for cases in which the sync column of bucardo_delta_targets does not exist when doing validate_sync.
Greg Sabino Mullane [Wed, 12 Sep 2012 22:13:39 +0000 (18:13 -0400)]
Add a single apostrophe to text values for additional quoting checks.
David E. Wheeler [Wed, 12 Sep 2012 22:12:01 +0000 (15:12 -0700)]
Report proper test failure context.
Added a few of these lines to BucardoTesting.pm:
local $Test::Builder::Level = $Test::Builder::Level + 1;
Because otherwise, Test::Builder reports the failure from the function or
method call in BucardoTesting.pm, rather than the calling `*.t` file. This
will make it easier to find the file and line of the actual test failure.
David E. Wheeler [Wed, 12 Sep 2012 21:55:47 +0000 (14:55 -0700)]
Add databas now works with the same parameters.
Greg says, via IRC, "We now allow that, for cool in-place table trimming." So
it seems as though the tests for it should be updated. And so they now are.
David E. Wheeler [Wed, 12 Sep 2012 21:41:30 +0000 (14:41 -0700)]
The pg_stat_activity PID column name has changed on 9.2.
So detect if we're on 9.2 or higher, and use the new name, `pid`. Still use
the old name, `procpid`, for older versions of PostgreSQL.
David E. Wheeler [Wed, 12 Sep 2012 21:22:40 +0000 (14:22 -0700)]
Turn list of prereqs into a Pod list and add boolean.
David E. Wheeler [Wed, 12 Sep 2012 21:14:56 +0000 (14:14 -0700)]
Report reason for compile failure.
Greg Sabino Mullane [Thu, 30 Aug 2012 18:22:31 +0000 (14:22 -0400)]
Tests for same-database
Greg Sabino Mullane [Thu, 23 Aug 2012 15:00:00 +0000 (11:00 -0400)]
Allow databases to have the same dsn, as we are moving towards in-database replication.
Greg Sabino Mullane [Thu, 23 Aug 2012 14:34:57 +0000 (10:34 -0400)]
Testing tweaks
Greg Sabino Mullane [Thu, 19 Jul 2012 11:29:27 +0000 (07:29 -0400)]
Note recent bug
Greg Sabino Mullane [Thu, 31 May 2012 17:40:16 +0000 (13:40 -0400)]
New siganture for 4.99.5
Greg Sabino Mullane [Thu, 31 May 2012 17:39:54 +0000 (13:39 -0400)]
Update MANIFEST
Greg Sabino Mullane [Thu, 31 May 2012 17:36:59 +0000 (13:36 -0400)]
Bump to version 4.99.5: get ready for next beta
Greg Sabino Mullane [Mon, 21 May 2012 16:50:08 +0000 (12:50 -0400)]
Minor sprintf fix to bucardo
Greg Sabino Mullane [Thu, 10 May 2012 19:39:33 +0000 (15:39 -0400)]
We have column names with underscores, thank you very much.
Ali Asad Lotia [Wed, 9 May 2012 20:56:39 +0000 (16:56 -0400)]
Make the summary usage message more consistent with the man page.
Items are listed in similar order on both pages. Additionally,
customname, customcols and customcode are mentioned in the usage
message. Finally the usage information for customname, customcols
and customcode are added to the man page.
Greg Sabino Mullane [Wed, 9 May 2012 00:02:09 +0000 (20:02 -0400)]
Testing tweaks.
Greg Sabino Mullane [Tue, 8 May 2012 20:30:52 +0000 (16:30 -0400)]
Switch back to Redis, as Redis::Client does not die smoothly on connection errors.
Greg Sabino Mullane [Tue, 8 May 2012 20:01:37 +0000 (16:01 -0400)]
Make sure we remove the tschema test schema in our tests.
Greg Sabino Mullane [Tue, 8 May 2012 19:47:25 +0000 (15:47 -0400)]
Allow spaces in customnames
Greg Sabino Mullane [Tue, 8 May 2012 19:46:57 +0000 (15:46 -0400)]
Tentative support for multi-column primary keys in MongoDB
Greg Sabino Mullane [Mon, 30 Apr 2012 14:15:54 +0000 (10:15 -0400)]
Changes file cleanups
Ali Asad Lotia [Mon, 30 Apr 2012 14:12:02 +0000 (10:12 -0400)]
Do not map NULL values to Mongo but simply drop them, as MongoDB is schemaless.
Greg Sabino Mullane [Sun, 29 Apr 2012 19:00:02 +0000 (15:00 -0400)]
Quick inline notes on how to handle common data mismatch problem.
Greg Sabino Mullane [Sun, 29 Apr 2012 03:37:46 +0000 (23:37 -0400)]
Chunk up the MongoDB deletes so as not to overwhelm the server on large tables.
May still require changing statement_chunk_size
Ed Snajder [Sun, 29 Apr 2012 02:38:50 +0000 (22:38 -0400)]
Should be setting, not value
Greg Sabino Mullane [Sun, 29 Apr 2012 02:12:40 +0000 (22:12 -0400)]
Better lookup for old bucardo_sequence tables.
Per mailing list question from Ed Snajder
Greg Sabino Mullane [Sat, 28 Apr 2012 23:59:31 +0000 (19:59 -0400)]
Credit last change.
Christian Recktenwald [Sat, 28 Apr 2012 23:58:14 +0000 (19:58 -0400)]
Add 'bucardo list all' to list everything at once.
Greg Sabino Mullane [Mon, 23 Apr 2012 19:27:25 +0000 (15:27 -0400)]
Add "one logfile per sync" idea from the ML.
Greg Sabino Mullane [Wed, 18 Apr 2012 15:18:05 +0000 (11:18 -0400)]
Fix up table names now that we are capping test3
Greg Sabino Mullane [Wed, 18 Apr 2012 14:07:38 +0000 (10:07 -0400)]
Try again for a unique var name
Greg Sabino Mullane [Tue, 17 Apr 2012 22:04:45 +0000 (18:04 -0400)]
Don't use variable names when a column name already exists - some versions of plpgsql will get confused.
Greg Sabino Mullane [Mon, 2 Apr 2012 16:45:34 +0000 (12:45 -0400)]
Show full name of relation when giving deadlock details. Fix missing comma.
Greg Sabino Mullane [Tue, 27 Mar 2012 21:19:13 +0000 (17:19 -0400)]
Spellcheck tweaks
Greg Sabino Mullane [Tue, 27 Mar 2012 20:28:15 +0000 (16:28 -0400)]
Finish up the Redis work, including a new test.
Also switch from the Redis Perl driver the Redis::Client, as the latter has hash support.
Greg Sabino Mullane [Tue, 27 Mar 2012 20:26:36 +0000 (16:26 -0400)]
Minor typos.
Greg Sabino Mullane [Fri, 23 Mar 2012 16:30:25 +0000 (12:30 -0400)]
Minor TODO updates.
Greg Sabino Mullane [Thu, 22 Mar 2012 19:58:15 +0000 (15:58 -0400)]
Add support for MariaDB
Greg Sabino Mullane [Thu, 22 Mar 2012 18:38:21 +0000 (14:38 -0400)]
Testing tweaks for SQLite