skytools.git
16 years agopython/pgq/cascade: proper process_root_node() calling
Marko Kreen [Mon, 4 May 2009 10:35:47 +0000 (13:35 +0300)]
python/pgq/cascade: proper process_root_node() calling

CascadedWorker did not call parent class method.

Also remove pointless logging from CascadedConsumer.

16 years agopgq.register_consumer_at(): update last seen timestamp on position move
Marko Kreen [Mon, 4 May 2009 10:31:02 +0000 (13:31 +0300)]
pgq.register_consumer_at(): update last seen timestamp on position move

16 years agoINSTALL: automake seems needed for aclocal
Marko Kreen [Mon, 4 May 2009 08:39:29 +0000 (11:39 +0300)]
INSTALL: automake seems needed for aclocal

16 years agotests/londiste: make logging verbose
Marko Kreen [Mon, 4 May 2009 07:48:56 +0000 (10:48 +0300)]
tests/londiste: make logging verbose

16 years agocascade: make wm publish periods configurable
Marko Kreen [Mon, 4 May 2009 07:37:00 +0000 (10:37 +0300)]
cascade: make wm publish periods configurable

This is mostly meant for testing.  The options may be removed or
renamed in the future.

Also fix bug in local wm publish function

16 years agocascade: fix watermark publishing
Marko Kreen [Sat, 2 May 2009 11:47:39 +0000 (14:47 +0300)]
cascade: fix watermark publishing

* CascadedWorker:
  - fix time comparision in local wm handling
  - publish wm also for leaf nodes
  - fields node_type, node_name, local_watermark were missing in WorkerState
* pgq_node.get_node_info: on leaf node set local watermark to last consumer tick
* pgq_node.set_global_watermark: don't depend on exact code from pgq_node.get_node_info()

Trying to special-case leaf nodes does not seem to be good idea, because
then provider nodes also need to know subscriber node type.  So stop doing it.

16 years agoadded a small useful example consumer
Asko Tiidumaa [Thu, 30 Apr 2009 11:19:19 +0000 (11:19 +0000)]
added a small useful example consumer

16 years agoMerge branch 'master' of git://github.com/markokr/skytools-dev
Asko Tiidumaa [Thu, 30 Apr 2009 11:17:37 +0000 (11:17 +0000)]
Merge branch 'master' of git://github.com/markokr/skytools-dev

16 years agosql/ticker: make routine database detection work.
Marko Kreen [Thu, 30 Apr 2009 10:06:54 +0000 (13:06 +0300)]
sql/ticker: make routine database detection work.

Previously databases were only detected at startup.

16 years agolondiste: cmd_execute() did not check ret_code of londiste.execute_start()
Marko Kreen [Thu, 30 Apr 2009 09:06:11 +0000 (12:06 +0300)]
londiste: cmd_execute() did not check ret_code of londiste.execute_start()

Also unify checking in both places - dont depend on exactly
'200' code from there.

16 years agolondiste copy: don't give -q unconditionally to copy process.
Marko Kreen [Wed, 29 Apr 2009 15:20:34 +0000 (18:20 +0300)]
londiste copy: don't give -q unconditionally to copy process.

Seems the original logic assument pgbouncer-like -q,
which only disabled stdout.  But DBScript sets
global log level with it.

16 years agoMerge commit 'origin/master'
Asko Tiidumaa [Wed, 29 Apr 2009 12:12:11 +0000 (12:12 +0000)]
Merge commit 'origin/master'

16 years agoMerge commit 'priit/master'
Marko Kreen [Wed, 29 Apr 2009 08:50:58 +0000 (11:50 +0300)]
Merge commit 'priit/master'

16 years agolondiste: unregister fix in playback.py
Priit Kustala [Tue, 28 Apr 2009 13:35:36 +0000 (13:35 +0000)]
londiste: unregister fix in playback.py

16 years agosql/ticker: ifdef SIGPIPE, SIGHUP for win32
Marko Kreen [Tue, 28 Apr 2009 19:53:44 +0000 (22:53 +0300)]
sql/ticker: ifdef SIGPIPE, SIGHUP for win32

16 years agocquoting: compat macros for MSC, minor cleanups
Marko Kreen [Tue, 28 Apr 2009 19:48:08 +0000 (22:48 +0300)]
cquoting: compat macros for MSC, minor cleanups

- MSC: macros for 'inline', 'strcasecmp'
- Use stdbool.h instead custom enum for 'bool'.

16 years agodevnotes: better formatting
Marko Kreen [Tue, 28 Apr 2009 19:44:33 +0000 (22:44 +0300)]
devnotes: better formatting

16 years agotag the tree as 3.0git
Marko Kreen [Tue, 28 Apr 2009 19:43:47 +0000 (22:43 +0300)]
tag the tree as 3.0git

16 years agosql/: Use more portable sed expression to get list of files.
Marko Kreen [Tue, 28 Apr 2009 19:42:26 +0000 (22:42 +0300)]
sql/: Use more portable sed expression to get list of files.

Old expression was not sed 3.x compatible, used in mingw.

16 years agolondiste add-table: if schema is missing, create
Marko Kreen [Tue, 28 Apr 2009 11:45:46 +0000 (14:45 +0300)]
londiste add-table: if schema is missing, create

16 years agodoc/devnotes: describe git usage more
Marko Kreen [Tue, 28 Apr 2009 11:44:55 +0000 (14:44 +0300)]
doc/devnotes: describe git usage more

16 years agodocs: nicer code blocks
Marko Kreen [Tue, 28 Apr 2009 11:44:27 +0000 (14:44 +0300)]
docs: nicer code blocks

16 years agoskytools.Config: use config file name as default job_name
Marko Kreen [Mon, 27 Apr 2009 19:49:46 +0000 (22:49 +0300)]
skytools.Config: use config file name as default job_name

16 years agoDBScript: avoid double config reload
Marko Kreen [Tue, 28 Apr 2009 11:51:10 +0000 (14:51 +0300)]
DBScript: avoid double config reload

also remove pointless job_name default, as it is already
handled in Config class.

16 years agoscripting: unify exception handling, show db name
Marko Kreen [Fri, 24 Apr 2009 14:32:28 +0000 (17:32 +0300)]
scripting: unify exception handling, show db name

Have single place where exceptions are handled.

psycopg attaches .cursor to each exception,
use that to show connection name in error messages.

16 years agoDecrease log level in pgq_node.get_node_info.sql and pgq_node.get_consumer_state.sql
Priit Kustala [Tue, 28 Apr 2009 10:25:38 +0000 (10:25 +0000)]
Decrease log level in pgq_node.get_node_info.sql and pgq_node.get_consumer_state.sql

16 years agofix in admin.py in get_node_subscriber_list ... remove local_watermark column from...
Priit Kustala [Mon, 27 Apr 2009 13:44:58 +0000 (13:44 +0000)]
fix in admin.py in get_node_subscriber_list ... remove local_watermark column from select

16 years agohello world
AskoTiidumaa [Mon, 27 Apr 2009 10:51:19 +0000 (10:51 +0000)]
hello world

16 years ago..
AskoTiidumaa [Mon, 27 Apr 2009 10:41:34 +0000 (10:41 +0000)]
..

16 years agopgq: some cleanups
Marko Kreen [Wed, 22 Apr 2009 14:13:31 +0000 (17:13 +0300)]
pgq: some cleanups

also remove silly co_name default.

16 years agosql/pgq: pgq.batch_retry()
Marko Kreen [Tue, 21 Apr 2009 19:57:03 +0000 (22:57 +0300)]
sql/pgq: pgq.batch_retry()

For use by pgq_coop.

16 years agopgq: Drop failed event handling.
Marko Kreen [Tue, 21 Apr 2009 10:08:08 +0000 (13:08 +0300)]
pgq: Drop failed event handling.

Badly designed and unused concept.  If such thing is needed
it's much better to handle them via actual queue.

16 years agoskytools3.txt: link to londiste demo
Marko Kreen [Mon, 20 Apr 2009 09:09:45 +0000 (12:09 +0300)]
skytools3.txt: link to londiste demo

16 years agoticker: fix cfparser conversion
Marko Kreen [Mon, 20 Apr 2009 09:06:42 +0000 (12:06 +0300)]
ticker: fix cfparser conversion

Agile copy-paste hurts.

Also mention heap-impl and base for libusual,
to get proper header dependencies.

16 years agoUpgrade to newer libusual
Marko Kreen [Mon, 20 Apr 2009 07:16:44 +0000 (10:16 +0300)]
Upgrade to newer libusual

- Use autoconf macros from usual.m4
- generate lib/usual/config.h
- ticker: use newer cfparser API
- ticker: use compat module

16 years agoticker: remove obsolete Assert()
Marko Kreen [Mon, 20 Apr 2009 07:10:40 +0000 (10:10 +0300)]
ticker: remove obsolete Assert()

16 years agoRefresh libusual
Marko Kreen [Wed, 15 Apr 2009 17:36:01 +0000 (20:36 +0300)]
Refresh libusual

16 years agofix query output formatting.
Martin Pihlak [Wed, 15 Apr 2009 13:58:53 +0000 (16:58 +0300)]
fix query output formatting.

16 years agoAdd ; to commands strings specified via -c
Martin Pihlak [Wed, 15 Apr 2009 13:29:43 +0000 (16:29 +0300)]
Add ; to commands strings specified via -c

16 years agoAllow queue name to be specified for register/unregister consumer.
Martin Pihlak [Wed, 15 Apr 2009 12:53:12 +0000 (15:53 +0300)]
Allow queue name to be specified for register/unregister consumer.

16 years agoAllow quoted queue and consumer names.
Martin Pihlak [Tue, 14 Apr 2009 14:00:02 +0000 (17:00 +0300)]
Allow quoted queue and consumer names.

16 years agoMerge branch 'master' of git://github.com/markokr/skytools-dev
Martin Pihlak [Tue, 14 Apr 2009 10:19:44 +0000 (13:19 +0300)]
Merge branch 'master' of git://github.com/markokr/skytools-dev

16 years agotests/londiste: reintroduce lost topo tests
Marko Kreen [Mon, 13 Apr 2009 20:19:51 +0000 (23:19 +0300)]
tests/londiste: reintroduce lost topo tests

16 years agodoc: move html cleaning to realclean skytools_3_0_a1
Marko Kreen [Mon, 13 Apr 2009 18:17:29 +0000 (21:17 +0300)]
doc: move html cleaning to realclean

16 years agotgz generation fixes
Marko Kreen [Mon, 13 Apr 2009 18:02:48 +0000 (21:02 +0300)]
tgz generation fixes

- include html files
- include scripts/*.ini
- include misc/*
- include *.ini under sql/

16 years agoMerge branch 'master' of git@github.com:markokr/skytools-dev
Marko Kreen [Mon, 13 Apr 2009 17:29:37 +0000 (20:29 +0300)]
Merge branch 'master' of git@github.com:markokr/skytools-dev

16 years agolast doc update
Marko Kreen [Mon, 13 Apr 2009 17:28:50 +0000 (20:28 +0300)]
last doc update

16 years agoMerge branch 'master' of git@github.com:markokr/skytools-dev
Marko Kreen [Mon, 13 Apr 2009 17:27:00 +0000 (20:27 +0300)]
Merge branch 'master' of git@github.com:markokr/skytools-dev

16 years agopgq/triggers: remove double include
Marko Kreen [Mon, 13 Apr 2009 17:22:00 +0000 (20:22 +0300)]
pgq/triggers: remove double include

Both I and Martin added the builtins.h.

16 years agotests/londiste: new tests
Marko Kreen [Mon, 13 Apr 2009 17:12:54 +0000 (20:12 +0300)]
tests/londiste: new tests

16 years agosql/ticker: accept subsecond timeouts
Marko Kreen [Mon, 13 Apr 2009 14:26:29 +0000 (17:26 +0300)]
sql/ticker: accept subsecond timeouts

also update it's todo

16 years agoMerge branch 'master' of git://github.com/markokr/skytools-dev
Marko Kreen [Mon, 13 Apr 2009 14:17:40 +0000 (17:17 +0300)]
Merge branch 'master' of git://github.com/markokr/skytools-dev

16 years agotag tree as 3.0a1
Marko Kreen [Mon, 13 Apr 2009 14:17:12 +0000 (17:17 +0300)]
tag tree as 3.0a1

16 years agosql/ticker: make timeouts work
Marko Kreen [Mon, 13 Apr 2009 14:15:51 +0000 (17:15 +0300)]
sql/ticker: make timeouts work

16 years agosource.cfg: include libusual in tgz
Marko Kreen [Mon, 13 Apr 2009 14:15:07 +0000 (17:15 +0300)]
source.cfg: include libusual in tgz

16 years agoconfigure.ac: Detect working gcc warning flags
Marko Kreen [Mon, 13 Apr 2009 14:14:35 +0000 (17:14 +0300)]
configure.ac: Detect working gcc warning flags

16 years agodocs: more updates
Marko Kreen [Thu, 9 Apr 2009 13:58:07 +0000 (16:58 +0300)]
docs: more updates

New devnotes.txt to help developers.

16 years agoImport fixes from 2.1-stable.
Marko Kreen [Thu, 9 Apr 2009 09:25:09 +0000 (12:25 +0300)]
Import fixes from 2.1-stable.

- make skytools pkg depend on rsync
- missing headers in Postgres modules
- quoting for numeric ident

16 years agotop Makefile: instead of explicit targets, use subdir targets
Marko Kreen [Mon, 13 Apr 2009 13:05:58 +0000 (16:05 +0300)]
top Makefile: instead of explicit targets, use subdir targets

16 years agodoc: update INSTALL on how to build from git
Marko Kreen [Mon, 13 Apr 2009 13:05:18 +0000 (16:05 +0300)]
doc: update INSTALL on how to build from git

16 years agosql/ticker: make pgqd compile & install without PGXS
Marko Kreen [Mon, 13 Apr 2009 12:42:38 +0000 (15:42 +0300)]
sql/ticker: make pgqd compile & install without PGXS

PGXS used Postgres prefix, but we want executables to use
skytools prefix.

This needed also C compilation support from autoconf.
Lift it from pgbouncer.

16 years agosql/ticker: Convert pgqd to libusual.
Marko Kreen [Mon, 13 Apr 2009 11:35:34 +0000 (14:35 +0300)]
sql/ticker: Convert pgqd to libusual.

Thus it aquires:
- daemonization
- logging
- config file
- event loop without full libevent

16 years agoadded missing header file "access/xact.h"
Martin Pihlak [Mon, 13 Apr 2009 11:25:05 +0000 (14:25 +0300)]
added missing header file "access/xact.h"

16 years agolib: Add libusual as subproject
Marko Kreen [Mon, 13 Apr 2009 10:05:31 +0000 (13:05 +0300)]
lib: Add libusual as subproject

16 years agoMerge commit 'martin/master'
Marko Kreen [Mon, 13 Apr 2009 10:03:08 +0000 (13:03 +0300)]
Merge commit 'martin/master'

16 years agotests: move londiste test from cascade/ to londiste/
Marko Kreen [Wed, 8 Apr 2009 16:40:44 +0000 (19:40 +0300)]
tests: move londiste test from cascade/ to londiste/

16 years agoApply ISC license clarification
Marko Kreen [Wed, 8 Apr 2009 15:31:41 +0000 (18:31 +0300)]
Apply ISC license clarification

  for f in `grep -rl 'and distribute' .`; do echo -e "%s;and distribute;and/or distribute;\nwq" | ed "$f"; done

More at: http://en.wikipedia.org/wiki/ISC_licence

16 years agoimport docs from 2.1
Marko Kreen [Wed, 8 Apr 2009 15:27:30 +0000 (18:27 +0300)]
import docs from 2.1

16 years agoMore doc updates for alpha
Marko Kreen [Wed, 8 Apr 2009 13:13:38 +0000 (16:13 +0300)]
More doc updates for alpha

16 years agosql/pgq_coop: Cooperative consuming
Marko Kreen [Wed, 8 Apr 2009 12:40:29 +0000 (15:40 +0300)]
sql/pgq_coop: Cooperative consuming

This module allows several consumers (subconsumers)
to share events between them so each subconsumers
sees only part of .

Implementation uses design described here:

 http://lists.pgfoundry.org/pipermail/skytools-users/2008-July/000653.html
 http://lists.pgfoundry.org/pipermail/skytools-users/2008-July/000671.html

Except instead <group>.<consumer> terminology <consumer>.<subconsumer>
is used.  Having 'consumer' mean different things seemed confusing.

Implemented by Asko Tiidumaa

16 years agoSeparated queue pause from external ticker.
Martin Pihlak [Wed, 8 Apr 2009 15:37:45 +0000 (18:37 +0300)]
Separated queue pause from external ticker.

16 years agoadded missing header files.
Martin Pihlak [Wed, 8 Apr 2009 15:06:46 +0000 (18:06 +0300)]
added missing header files.

16 years agosql/pgq: allow sub_last_tick to be NULL (pgq_coop)
Marko Kreen [Wed, 8 Apr 2009 13:03:56 +0000 (16:03 +0300)]
sql/pgq: allow sub_last_tick to be NULL (pgq_coop)

16 years agosql/pgq: pgq.get_batch_cursor()
Marko Kreen [Wed, 8 Apr 2009 09:45:26 +0000 (12:45 +0300)]
sql/pgq: pgq.get_batch_cursor()

Helper function to fetch batch events using a cursor.

16 years agosql/londiste: types.sql was removed
Marko Kreen [Wed, 8 Apr 2009 13:25:56 +0000 (16:25 +0300)]
sql/londiste: types.sql was removed

16 years ago- add PQerrorMessage to conn_error()
Martin Pihlak [Wed, 8 Apr 2009 13:30:54 +0000 (16:30 +0300)]
- add PQerrorMessage to conn_error()
- reconnect on db error and timeout
- getopt parentheses bugfix

16 years agoMerge branch 'master' of git://github.com/markokr/skytools-dev
Martin Pihlak [Wed, 8 Apr 2009 07:30:59 +0000 (10:30 +0300)]
Merge branch 'master' of git://github.com/markokr/skytools-dev

16 years agoBuildsystem update
Marko Kreen [Tue, 7 Apr 2009 12:57:57 +0000 (15:57 +0300)]
Buildsystem update

- apply asciidoc/xmlto fixes from -stable
- make strip-ext default
- deb84 target
- reorder fields in setup.py
- email update
- install html docs under share/doc/skytools
- deb: build-dep on asciidoc+xmlto (temporarily?)

16 years agosql/londiste: update regtest for fixed message
Marko Kreen [Tue, 7 Apr 2009 10:52:08 +0000 (13:52 +0300)]
sql/londiste: update regtest for fixed message

16 years agosql/londiste: allow missing pkey in case of merged table.
Marko Kreen [Tue, 7 Apr 2009 10:50:42 +0000 (13:50 +0300)]
sql/londiste: allow missing pkey in case of merged table.

Check if pkey is dropped by londiste itself.

16 years agoFix copy filtering.
Marko Kreen [Tue, 7 Apr 2009 10:38:22 +0000 (13:38 +0300)]
Fix copy filtering.

Adding filtering in case of sending events into combined queue
broke default copy-everything for plain cascading.  Fix it by
adding addition argument to .copy_event() whether filtering
should be performed or not.

16 years agoMerge branch 'master' of git://github.com/markokr/skytools-dev
Martin Pihlak [Mon, 6 Apr 2009 09:39:29 +0000 (12:39 +0300)]
Merge branch 'master' of git://github.com/markokr/skytools-dev

16 years agoVarious doc updates in preparation for alpha.
Marko Kreen [Thu, 2 Apr 2009 13:46:18 +0000 (16:46 +0300)]
Various doc updates in preparation for alpha.

16 years agosql/ticker: experimental multi-database ticker written in C
Marko Kreen [Wed, 18 Mar 2009 16:26:02 +0000 (18:26 +0200)]
sql/ticker: experimental multi-database ticker written in C

The new ticker is based on libevent, uses single-threaded
async  architecture.

It can handle all databases in one Postgres instance, so you
need only one ticker instance per Postgres instance.

By default it autodetects all accessible databases and
whether they have PGQ installed.

Missing features ATM:
- logging
- config files
- daemonizing
- error handling

So it's not production quality yet..

16 years agopgq: Ability to limit the number of events inserted by one TX
Marko Kreen [Thu, 2 Apr 2009 10:34:39 +0000 (13:34 +0300)]
pgq: Ability to limit the number of events inserted by one TX

As PgQ can split batches only on transaction boundaries,
it does not tolerate huge number of events inserted by one TX.

This batch adds per-queue field queue_per_tx_limit, which can be
set to reasonable number and PgQ will enforce the limit, by throwing
error if event counts gets larger, thus rollbacking the problematic TX.

Such limit also adds possibility to survive UPDATE/DELETE statements,
where the WHERE clause is missing or buggy.

16 years agosql/pgq: reindent C code
Marko Kreen [Thu, 2 Apr 2009 11:30:47 +0000 (14:30 +0300)]
sql/pgq: reindent C code

Several places had whitespace bugs, probably due to copy-paste.

As there is no point keeping historical PG style around here,
reindent with proper -kr -i8.

16 years agoImplemented SHOW CONSUMER command.
Martin Pihlak [Fri, 27 Mar 2009 14:54:52 +0000 (16:54 +0200)]
Implemented SHOW CONSUMER command.

16 years ago- added pgq.set_queue_config function
Martin Pihlak [Fri, 20 Mar 2009 12:09:44 +0000 (14:09 +0200)]
- added pgq.set_queue_config function
- almost usable ALTER QUEUE
- simple feedback for non-show commands

16 years agoPreparation for pgq_coop: make sub_id non-unique.
Marko Kreen [Wed, 18 Mar 2009 09:07:31 +0000 (11:07 +0200)]
Preparation for pgq_coop: make sub_id non-unique.

To allow sharing retry events between coop consumers,
the simplest way is to make then share same sub_id.
So remove any assumptions from the code that
sub_id is unique.

This patch also fixes 2 long-standing bugs:
- pgq.retry_queue had double index
- pgq.subscription.batch_id did not had index

As both had only minor effect on performance, they went
unnoticed so long.

16 years agonewadm.txt: refresh and mention pending issues
Marko Kreen [Fri, 13 Mar 2009 09:40:31 +0000 (11:40 +0200)]
newadm.txt: refresh and mention pending issues

16 years agonewadm: SHOW HELP
Marko Kreen [Fri, 13 Mar 2009 09:39:47 +0000 (11:39 +0200)]
newadm: SHOW HELP

16 years agonewadm: more commands work now
Marko Kreen [Wed, 11 Mar 2009 13:53:05 +0000 (15:53 +0200)]
newadm: more commands work now

- register
- unregister
- create queue
- drop queue
- show batch
- show queue

16 years agoexperimental newadm code
Marko Kreen [Mon, 9 Mar 2009 16:17:05 +0000 (18:17 +0200)]
experimental newadm code

16 years agotodo: update
Marko Kreen [Mon, 9 Mar 2009 07:03:16 +0000 (09:03 +0200)]
todo: update

16 years agotests for combined queue_loader
Marko Kreen [Tue, 17 Feb 2009 12:22:58 +0000 (14:22 +0200)]
tests for combined queue_loader

16 years agoparsing.py: export sql_tokenizer, tag errors
Marko Kreen [Mon, 9 Mar 2009 06:59:03 +0000 (08:59 +0200)]
parsing.py: export sql_tokenizer, tag errors

16 years agoproper error message in pgq_code.create_node()
Marko Kreen [Mon, 9 Mar 2009 06:58:14 +0000 (08:58 +0200)]
proper error message in pgq_code.create_node()

16 years agopsycopgwrapper: export connect_database()
Marko Kreen [Mon, 9 Mar 2009 06:57:33 +0000 (08:57 +0200)]
psycopgwrapper: export connect_database()

16 years agopgq: disable manual vacuuming if autovacuum works
Marko Kreen [Mon, 2 Mar 2009 09:09:07 +0000 (11:09 +0200)]
pgq: disable manual vacuuming if autovacuum works

16 years agolog message fix.
Martin Pihlak [Fri, 6 Mar 2009 14:06:10 +0000 (16:06 +0200)]
log message fix.