skytools.git
14 years agopgq_node.upgrade_schema(): magic schema upgrade
Marko Kreen [Thu, 8 Sep 2011 15:10:35 +0000 (17:10 +0200)]
pgq_node.upgrade_schema(): magic schema upgrade

also sync regtest output

14 years agopgq.upgrade_schema(): magic schema upgrade
Marko Kreen [Thu, 8 Sep 2011 14:58:14 +0000 (16:58 +0200)]
pgq.upgrade_schema(): magic schema upgrade

14 years agoscripts/scriptmgr.py: ignoring stale pid files when starting scripts
martinko [Wed, 7 Sep 2011 08:52:08 +0000 (10:52 +0200)]
scripts/scriptmgr.py: ignoring stale pid files when starting scripts

14 years agosetup_skytools: add vars to turn of script/sql installation
Marko Kreen [Wed, 7 Sep 2011 12:55:50 +0000 (14:55 +0200)]
setup_skytools: add vars to turn of script/sql installation

14 years agoCascadedConsumer: allow --reset without consumer info
Marko Kreen [Wed, 7 Sep 2011 11:01:01 +0000 (13:01 +0200)]
CascadedConsumer: allow --reset without consumer info

Can happen for worker on root node.

14 years agosetup_skytools: no rename by default on win32
Marko Kreen [Tue, 6 Sep 2011 22:05:22 +0000 (00:05 +0200)]
setup_skytools: no rename by default on win32

14 years agoDon't build C module on windows, minor fixes
Marko Kreen [Tue, 6 Sep 2011 21:44:24 +0000 (23:44 +0200)]
Don't build C module on windows, minor fixes

14 years agoMore build work
Marko Kreen [Tue, 6 Sep 2011 20:59:01 +0000 (22:59 +0200)]
More build work

- separate build dir for setup_skytools, to avoid conflict with pkgloader
- pass configure switches to setup.py

14 years agodoc: remove obsolete documentation
Marko Kreen [Mon, 5 Sep 2011 19:42:16 +0000 (21:42 +0200)]
doc: remove obsolete documentation

14 years agohandlers/dispatch.py: temporarily use real table
Marko Kreen [Mon, 5 Sep 2011 19:41:27 +0000 (21:41 +0200)]
handlers/dispatch.py: temporarily use real table

14 years agoMove install logic from Makefile to setup_skytools.py
Marko Kreen [Mon, 5 Sep 2011 19:40:33 +0000 (21:40 +0200)]
Move install logic from Makefile to setup_skytools.py

14 years ago.itignore: remove .sql files
Marko Kreen [Mon, 5 Sep 2011 12:51:00 +0000 (15:51 +0300)]
.itignore: remove .sql files

14 years agopgq_coop: use 'install.sql' file
Marko Kreen [Mon, 5 Sep 2011 11:05:59 +0000 (14:05 +0300)]
pgq_coop: use 'install.sql' file

14 years agopgq_node: use 'install.sql' file
Marko Kreen [Mon, 5 Sep 2011 11:04:20 +0000 (14:04 +0300)]
pgq_node: use 'install.sql' file

14 years agosql/londiste: use 'install.sql' file
Marko Kreen [Mon, 5 Sep 2011 11:03:21 +0000 (14:03 +0300)]
sql/londiste: use 'install.sql' file

14 years agopgq_ext: use single 'install.sql' file
Marko Kreen [Mon, 5 Sep 2011 11:02:35 +0000 (14:02 +0300)]
pgq_ext: use single 'install.sql' file

14 years agopgq_lowlevel.sql: stop building it
Marko Kreen [Mon, 5 Sep 2011 10:53:52 +0000 (13:53 +0300)]
pgq_lowlevel.sql: stop building it

14 years agopgq_triggers.sql: stop building the file
Marko Kreen [Mon, 5 Sep 2011 10:10:20 +0000 (13:10 +0300)]
pgq_triggers.sql: stop building the file

due to new extensions work, the file is now fixed

14 years agolondiste.handlers.bulk: fix real table creation
Marko Kreen [Tue, 30 Aug 2011 11:28:55 +0000 (14:28 +0300)]
londiste.handlers.bulk: fix real table creation

14 years agolondiste.handlers.bulk: hack - try to use real table
Marko Kreen [Tue, 30 Aug 2011 11:26:48 +0000 (14:26 +0300)]
londiste.handlers.bulk: hack - try to use real table

14 years agoMerge remote-tracking branch 'martino/master'
Marko Kreen [Wed, 24 Aug 2011 08:56:43 +0000 (11:56 +0300)]
Merge remote-tracking branch 'martino/master'

14 years agoscripting.py: added some aliases in BaseScript
martinko [Tue, 23 Aug 2011 16:15:46 +0000 (18:15 +0200)]
scripting.py: added some aliases in BaseScript

stat_add -> stat_put
stat_inc -> stat_increase

14 years agolondiste.table_copy/merge: don't restart failed DDL restore
Marko Kreen [Mon, 22 Aug 2011 14:45:23 +0000 (17:45 +0300)]
londiste.table_copy/merge: don't restart failed DDL restore

it will start truncate/copy again, which will be unnoticeable
to other partitions.

Proper fix would be to restart DDL-only, but currently
there is no way to detect the situation.

14 years agotests/noqueue: minor improvements
Marko Kreen [Fri, 19 Aug 2011 07:53:31 +0000 (10:53 +0300)]
tests/noqueue: minor improvements

- avoid hardcoded sleeps
- avoid hardcoded part count

14 years agoskytools.BaseScript: fix attribute typo (cf_override)
Marko Kreen [Fri, 19 Aug 2011 07:52:17 +0000 (10:52 +0300)]
skytools.BaseScript: fix attribute typo (cf_override)

14 years agoconfig.py: added items() and has_section() methods to simplify certain usecases
martinko [Mon, 22 Aug 2011 11:49:50 +0000 (13:49 +0200)]
config.py: added items() and has_section() methods to simplify certain usecases

14 years agominor typos fixed
martinko [Mon, 22 Aug 2011 11:18:36 +0000 (13:18 +0200)]
minor typos fixed

14 years agocascaded unregister-location
Egon Valdmees [Fri, 29 Jul 2011 10:08:20 +0000 (13:08 +0300)]
cascaded unregister-location

Instead of running drop_node function on every node in cascade,
unregister-location event added to queue by master

14 years agochanged invalid utf8 log level to info
Egon Valdmees [Mon, 1 Aug 2011 12:12:53 +0000 (15:12 +0300)]
changed invalid utf8 log level to info

14 years agofix: expect_sync to londiste.local_add_table i_trg_args
Egon Valdmees [Tue, 19 Jul 2011 11:29:18 +0000 (14:29 +0300)]
fix: expect_sync to londiste.local_add_table i_trg_args

14 years agomultimaster handler
Egon Valdmees [Tue, 19 Jul 2011 10:33:34 +0000 (13:33 +0300)]
multimaster handler

14 years agono-merge argument
Egon Valdmees [Tue, 19 Jul 2011 10:32:34 +0000 (13:32 +0300)]
no-merge argument

when using it table is not merged from source queues

14 years agosql/conflicthandler: experimental conflict handler.
Marko Kreen [Tue, 12 Jul 2011 11:17:49 +0000 (14:17 +0300)]
sql/conflicthandler: experimental conflict handler.

skytools.plpy_applyrow: low-level helper module

conflicthandler/merge_on_time.sql: sample time-based conflict handler

14 years agohandlers.dispatch: utf8 fix - show values only in debug level
Marko Kreen [Thu, 7 Jul 2011 12:50:18 +0000 (15:50 +0300)]
handlers.dispatch: utf8 fix - show values only in debug level

14 years agoCoopConsumer: another fix for --unregister
Marko Kreen [Wed, 6 Jul 2011 11:37:17 +0000 (14:37 +0300)]
CoopConsumer: another fix for --unregister

14 years agofor out param table_name intermediate variable used var_table_name
Priit Kustala [Thu, 7 Jul 2011 12:32:05 +0000 (12:32 +0000)]
for out param table_name intermediate variable used var_table_name

14 years agosafe_utf8_decode: stop using builtin 'replace', its broken
Marko Kreen [Tue, 5 Jul 2011 09:48:06 +0000 (12:48 +0300)]
safe_utf8_decode: stop using builtin 'replace', its broken

Default 'replace' can eat several symbols, which means
it can corrupt even regular ascii.

14 years agoCascadeAdmin: node-info command
Marko Kreen [Mon, 4 Jul 2011 12:05:35 +0000 (15:05 +0300)]
CascadeAdmin: node-info command

Shows detailed info about local node.

Currently the info needs to be gathered from different places,
which is annoying.

14 years agoCoopConsumer: Fix --unregister command.
Marko Kreen [Mon, 4 Jul 2011 11:49:51 +0000 (14:49 +0300)]
CoopConsumer: Fix --unregister command.

DB function has 4 arguments not 3

14 years agoskytools.DBScript: drop connection if connect string has changed
Marko Kreen [Mon, 4 Jul 2011 11:48:40 +0000 (14:48 +0300)]
skytools.DBScript: drop connection if connect string has changed

.reload() happens between .work() calls, so it's safe to
drop connection on first .get_database()

14 years agomisc/bumpver: add pgq_coop schema for checking
Marko Kreen [Wed, 29 Jun 2011 07:34:13 +0000 (10:34 +0300)]
misc/bumpver: add pgq_coop schema for checking

14 years agopgq_coop.version(): 3.0.0.2
Marko Kreen [Wed, 29 Jun 2011 07:33:47 +0000 (10:33 +0300)]
pgq_coop.version(): 3.0.0.2

14 years agopgq_coop.next_batch: do not kill master consumer
Marko Kreen [Wed, 29 Jun 2011 07:08:59 +0000 (10:08 +0300)]
pgq_coop.next_batch: do not kill master consumer

14 years agoskytools.sockutil: separate module for low-level socket stuff
Marko Kreen [Tue, 28 Jun 2011 15:28:50 +0000 (18:28 +0300)]
skytools.sockutil: separate module for low-level socket stuff

Move set_tcp_keepalive() here, plus set_nonblocking() and
set_cloexec().

14 years agoFix various pylint errors
Marko Kreen [Tue, 28 Jun 2011 14:00:58 +0000 (17:00 +0300)]
Fix various pylint errors

14 years agopgq_coop.register_subconsumer: make sure main consumer exists
Marko Kreen [Tue, 28 Jun 2011 13:38:47 +0000 (16:38 +0300)]
pgq_coop.register_subconsumer: make sure main consumer exists

14 years agopgq_coop: add public grant for schema
Marko Kreen [Tue, 28 Jun 2011 12:43:39 +0000 (15:43 +0300)]
pgq_coop: add public grant for schema

14 years agoMakefile: add more modules to doctest
Marko Kreen [Tue, 28 Jun 2011 13:12:10 +0000 (16:12 +0300)]
Makefile: add more modules to doctest

14 years agoSimplify utf8 sanitizer and move under skytools/
Marko Kreen [Tue, 28 Jun 2011 12:32:28 +0000 (15:32 +0300)]
Simplify utf8 sanitizer and move under skytools/

This patch moves sanitizer under skytools.utf8 and makes
is generally usable, also better testable.

14 years agoskytools/__init__: setup proper __all__
Marko Kreen [Tue, 28 Jun 2011 12:31:24 +0000 (15:31 +0300)]
skytools/__init__: setup proper __all__

14 years agolondiste.handlers: .needs_table method
Marko Kreen [Tue, 28 Jun 2011 12:28:38 +0000 (15:28 +0300)]
londiste.handlers: .needs_table method

handler can specify whether is actually operates on table

14 years agolondiste.setup: disable existence check when --force is used
Marko Kreen [Tue, 28 Jun 2011 08:57:11 +0000 (11:57 +0300)]
londiste.setup: disable existence check when --force is used

this is (temp) solution for handlers that do not need
actual table.

14 years agoparse_pgarray: more strict error checking
Marko Kreen [Tue, 21 Jun 2011 07:46:23 +0000 (10:46 +0300)]
parse_pgarray: more strict error checking

14 years agoencodingvalidator: fix utf16 surrogate pairs
Marko Kreen [Mon, 20 Jun 2011 13:03:33 +0000 (16:03 +0300)]
encodingvalidator: fix utf16 surrogate pairs

seems like python does not think of them as errors

14 years agohandlers.dispatch: move encoding validator upwards
Marko Kreen [Mon, 20 Jun 2011 10:49:02 +0000 (13:49 +0300)]
handlers.dispatch: move encoding validator upwards

Otherwise it may miss bad pkey values.

14 years agomisc/bumpver: add db ver scripts to git
Marko Kreen [Fri, 17 Jun 2011 11:37:58 +0000 (14:37 +0300)]
misc/bumpver: add db ver scripts to git

14 years agolondiste.version(): 3.0.0.8
Marko Kreen [Fri, 17 Jun 2011 11:36:45 +0000 (14:36 +0300)]
londiste.version(): 3.0.0.8

14 years agopgq_node.version(): 3.0.0.8
Marko Kreen [Fri, 17 Jun 2011 11:36:45 +0000 (14:36 +0300)]
pgq_node.version(): 3.0.0.8

14 years agolondiste.handlers.dispatch: use 'global' instead 'globals()[]'
Marko Kreen [Fri, 17 Jun 2011 11:27:45 +0000 (14:27 +0300)]
londiste.handlers.dispatch: use 'global' instead 'globals()[]'

14 years agofix: table rules are incorrect after londiste3 table (re)sync
Egon Valdmees [Thu, 16 Jun 2011 12:09:57 +0000 (15:09 +0300)]
fix: table rules are incorrect after londiste3 table (re)sync

14 years agopart handler
Egon Valdmees [Tue, 14 Jun 2011 13:50:53 +0000 (16:50 +0300)]
part handler

handler adds trigger argument to full extra3 field with hash value and
filter to event_processing and full_copy

14 years agosqltools.full_copy variable name fix
Egon Valdmees [Wed, 15 Jun 2011 11:22:41 +0000 (14:22 +0300)]
sqltools.full_copy variable name fix

14 years agosort table list by name
Egon Valdmees [Wed, 8 Jun 2011 08:56:53 +0000 (11:56 +0300)]
sort table list by name

14 years agofix for "NoneType object not subscriptable" error in dispatcher encoding validation
Egon Valdmees [Tue, 7 Jun 2011 14:32:06 +0000 (17:32 +0300)]
fix for "NoneType object not subscriptable" error in dispatcher encoding validation

14 years agofixed merge testcode
Egon Valdmees [Tue, 7 Jun 2011 12:49:00 +0000 (15:49 +0300)]
fixed merge testcode

14 years agoleaf branch now accepts add-table events
Egon Valdmees [Tue, 7 Jun 2011 12:24:53 +0000 (15:24 +0300)]
leaf branch now accepts add-table events

14 years agofake_local and qsplitter handlers
Egon Valdmees [Wed, 1 Jun 2011 14:07:36 +0000 (17:07 +0300)]
fake_local and qsplitter handlers

added new handlers:
* fake_local  - dummy handler to setup queue tables. All events are ignored. Table structure is not required. Use in branch/leaf
* qsplitter  -  dummy handler to setup queue tables. All events are ignored. Table structure is not required. All table events are inserted to destination queue, specified with handler arg 'queue'.

changed local_add_table to allow adding of non-existing tables

14 years agorenamed direct handler func name
Egon Valdmees [Wed, 1 Jun 2011 14:02:01 +0000 (17:02 +0300)]
renamed direct handler func name

14 years agoMerge branch 'master' of lux-dbeer:code/skytools-3
Egon Valdmees [Wed, 1 Jun 2011 07:20:14 +0000 (10:20 +0300)]
Merge branch 'master' of lux-dbeer:code/skytools-3

14 years agono crash when column detection fails
Egon Valdmees [Wed, 1 Jun 2011 06:46:57 +0000 (09:46 +0300)]
no crash when column detection fails

14 years agoMerge branch 'master' of https://github.com/markokr/skytools
Egon Valdmees [Wed, 1 Jun 2011 06:38:34 +0000 (06:38 +0000)]
Merge branch 'master' of https://github.com/markokr/skytools

14 years agodirect handler
Egon Valdmees [Tue, 31 May 2011 12:00:24 +0000 (15:00 +0300)]
direct handler

direct handler is functionally identical with
table handler (default when no handler specified),
but uses dispatch handler logic

14 years agoerror when fixing utf8 in rows with null values
Egon Valdmees [Tue, 31 May 2011 11:58:59 +0000 (14:58 +0300)]
error when fixing utf8 in rows with null values

14 years agocascade event log level to debug
Egon Valdmees [Mon, 30 May 2011 13:20:41 +0000 (16:20 +0300)]
cascade event log level to debug

14 years agoskytools.Config: switch to turn off all default values
Marko Kreen [Tue, 31 May 2011 08:11:13 +0000 (11:11 +0300)]
skytools.Config: switch to turn off all default values

14 years agotable locality check for multi-source leaf
Egon Valdmees [Thu, 26 May 2011 13:52:44 +0000 (16:52 +0300)]
table locality check for multi-source leaf

14 years agosubconsumer (un)registration to qadmin
Egon Valdmees [Fri, 13 May 2011 12:03:18 +0000 (15:03 +0300)]
subconsumer (un)registration to qadmin

14 years agoOCM-2211 pgq_coop doesnt remove timed out subconsumers without active batch
Egon Valdmees [Mon, 9 May 2011 13:54:53 +0000 (16:54 +0300)]
OCM-2211 pgq_coop doesnt remove timed out subconsumers without active batch

14 years agoOCM-2279: londiste3 should translate everything to utf8, in a lossy way
Egon Valdmees [Thu, 5 May 2011 12:37:54 +0000 (15:37 +0300)]
OCM-2279: londiste3 should translate everything to utf8, in a lossy way
where appropriate

* added argument 'encoding' to dispatcher handler
* tests for invalid utf8 sequences
* support for renamed table copy in dispatcher handler

14 years agotable name and columns change support for full_copy
Egon Valdmees [Tue, 8 Feb 2011 13:20:11 +0000 (15:20 +0200)]
table name and columns change support for full_copy

added support for destination table and columns with
different name than source

14 years agoapplyfunc handler
Marko Kreen [Fri, 6 May 2011 13:44:14 +0000 (16:44 +0300)]
applyfunc handler

14 years agofixed failed sync exit code
Tarvi Pillessaar [Wed, 27 Apr 2011 09:48:29 +0000 (09:48 +0000)]
fixed failed sync exit code

14 years agopgq.triggers: Fix potential rare crash.
Marko Kreen [Tue, 19 Apr 2011 21:03:32 +0000 (00:03 +0300)]
pgq.triggers: Fix potential rare crash.

The bad hash_search(HASH_ENTER) + SPI_execute() pattern
is used here also.  Fix it by always properly initializing
the info structure.

The similar pattern exist also in PgqTriggerInfo, but that
is already handled via ->finalized flag.

14 years agopgq.insert_event: Fix rare crash
Marko Kreen [Tue, 19 Apr 2011 20:22:08 +0000 (23:22 +0300)]
pgq.insert_event: Fix rare crash

If hash_search(HASH_ENTER) succeeds, but make_plan() fails,
due to statement_timeout/deadlock, then HTAB entry will
contain invalid values which leads to crash on next call.

Fix it by always fully initializing struct before calling make_plan().

Debugged-by: Martin Pihlak
14 years agomake deb: shortcut for unofficial packages
Marko Kreen [Fri, 15 Apr 2011 10:19:28 +0000 (13:19 +0300)]
make deb: shortcut for unofficial packages

14 years agodeb: Improve dependencies
Marko Kreen [Fri, 15 Apr 2011 09:14:15 +0000 (12:14 +0300)]
deb: Improve dependencies

Source:
- Ticker is not built with libevent-dev
- python-psycopg2 is not needed for building

python-pgq3
- Depends on python-psycopg2

skytools3-walmgr:
- Depends on python-psycopg2
- Does not depend on postgresql-server, it is reasonable to use
  it to manage non-debian Postgres instances.  Make it 'Enhances:'
  instead.

python-skytools3:
- Suggest: python-psycopg2.  Needed for DB functionality, not otherwise.

14 years agoskytools.natsort: natural sorting of strings
Marko Kreen [Tue, 12 Apr 2011 08:39:38 +0000 (11:39 +0300)]
skytools.natsort: natural sorting of strings

14 years agoskytools: Option of non-lazy loading for various checkers
Marko Kreen [Thu, 7 Apr 2011 12:58:03 +0000 (15:58 +0300)]
skytools: Option of non-lazy loading for various checkers

14 years agoskytools: Separate generic scripting from DBScript
Marko Kreen [Thu, 7 Apr 2011 12:57:28 +0000 (15:57 +0300)]
skytools: Separate generic scripting from DBScript

14 years agosplit skytools3 in several packages for debian
Dimitri Fontaine [Thu, 31 Mar 2011 13:41:01 +0000 (15:41 +0200)]
split skytools3 in several packages for debian

skytools3              Skytool's replication and queuing
python-pgq3            Skytool's PGQ python library
python-skytools3       python scripts framework for skytools
skytools-ticker3       PGQ ticker daemon service
skytools-walmgr3       high-availability archive and restore commands
postgresql-8.4-pgq3    PGQ server-side code (C module for PostgreSQL)
postgresql-9.0-pgq3    PGQ server-side code (C module for PostgreSQL)

You can install your script in /etc/skytools/*.ini and the skytools package
will try to start them automatically, using scriptmgr.  Of course you still
need to install pgq for ticker services and londiste for replication.

14 years agoOCM-1524: merge_all switch for non-queue merge leaf
Egon Valdmees [Tue, 12 Apr 2011 11:00:14 +0000 (14:00 +0300)]
OCM-1524: merge_all switch for non-queue merge leaf

14 years agoOCM-1524: syntax error fix and added tests
Egon Valdmees [Mon, 11 Apr 2011 12:53:44 +0000 (15:53 +0300)]
OCM-1524: syntax error fix and added tests

14 years agoOCM-704: creating merge-leaf with non-existing queue on leaf side should throw an...
Egon Valdmees [Fri, 8 Apr 2011 14:20:09 +0000 (17:20 +0300)]
OCM-704: creating merge-leaf with non-existing queue on leaf side should throw an error

14 years agoOCM-1581: skytools3 script error "Config value not set: subconsumer_timeout"
Egon Valdmees [Fri, 8 Apr 2011 14:19:47 +0000 (17:19 +0300)]
OCM-1581: skytools3 script error "Config value not set: subconsumer_timeout"

14 years agoOCM-1538: londiste3 qtable plugin behaves dangerously when adding skip trigger to...
Egon Valdmees [Fri, 8 Apr 2011 14:16:28 +0000 (17:16 +0300)]
OCM-1538: londiste3 qtable plugin behaves dangerously when adding skip trigger to a existing queue table

14 years agoOCM-1524: adding table to n:1 cascade merge should work as with merge-leaf scenario
Egon Valdmees [Fri, 8 Apr 2011 14:15:22 +0000 (17:15 +0300)]
OCM-1524: adding table to n:1 cascade merge should work as with merge-leaf scenario

14 years agoAvoid direct symbol imports
Marko Kreen [Wed, 6 Apr 2011 17:42:31 +0000 (20:42 +0300)]
Avoid direct symbol imports

Always use

  import skytools
  def xx():
   skytools.foo

this allows maximum laziness when importing.

14 years agorefresh libusual
Marko Kreen [Wed, 6 Apr 2011 16:35:53 +0000 (19:35 +0300)]
refresh libusual

14 years agoskytools: Convert __init__ module to apipkg
Marko Kreen [Wed, 6 Apr 2011 16:13:06 +0000 (19:13 +0300)]
skytools: Convert __init__ module to apipkg

14 years agoskytools: Include apipkg module
Marko Kreen [Wed, 6 Apr 2011 16:09:52 +0000 (19:09 +0300)]
skytools: Include apipkg module

Include Holger Krekel's apipkg module in skytools.

It allows top module to lazily load symbols from submodules.