skytools.git
13 years agodebian: orig - use top-level 'make tgz' to make tarball
Marko Kreen [Wed, 4 Jan 2012 20:27:41 +0000 (22:27 +0200)]
debian: orig - use top-level 'make tgz' to make tarball

Otherwise we need to maintain two ways to build source.

13 years agodebian: more cleanups
Marko Kreen [Wed, 4 Jan 2012 20:05:15 +0000 (22:05 +0200)]
debian: more cleanups

- Use ./autgen instead autoreconf.  Latter is broken on non-automake trees.
- Drop override_dh_auto_build, seems unnecessary.
- Move config.mak dep from override_dh_auto_build to override_dh_auto_configure

13 years agodebian: add support files for 8.3 and 9.2
Marko Kreen [Wed, 4 Jan 2012 19:09:57 +0000 (21:09 +0200)]
debian: add support files for 8.3 and 9.2

13 years agodebian/: cleanup and sync with other build changes
Marko Kreen [Wed, 4 Jan 2012 11:34:58 +0000 (13:34 +0200)]
debian/: cleanup and sync with other build changes

- remove hardwired 9.1
- dont touch anything under upgrade/
- configure: use --with-sk3-subdir
- install under /usr/share/skytools3 is done by setup_skytools.py

13 years agodoc: restore queue_mover & queue_splitter docs
Marko Kreen [Wed, 4 Jan 2012 11:32:55 +0000 (13:32 +0200)]
doc: restore queue_mover & queue_splitter docs

as we still install those scripts, keep their doc around

13 years agocreate partition: cleanup code
Marko Kreen [Tue, 3 Jan 2012 22:46:37 +0000 (00:46 +0200)]
create partition: cleanup code

- use proper quoting
- simplify grants
- use "including defaults" to lessen differences from "including all"

13 years agolondiste.version(): 3.0.0.13
Marko Kreen [Fri, 30 Dec 2011 12:17:42 +0000 (14:17 +0200)]
londiste.version(): 3.0.0.13

13 years agolondiste.get_table_list: move complex copy logic away
Marko Kreen [Fri, 30 Dec 2011 12:01:37 +0000 (14:01 +0200)]
londiste.get_table_list: move complex copy logic away

It is now in separate function and called only
for 'in-copy' and 'catching-up' tables.

Should make things more maintainable and speed up common case.

13 years agodbstruct: support grants 'WITH GRANT OPTION'
Marko Kreen [Fri, 30 Dec 2011 12:00:58 +0000 (14:00 +0200)]
dbstruct: support grants 'WITH GRANT OPTION'

13 years agohandlers.dispatch: Move grants into sql function
Marko Kreen [Fri, 30 Dec 2011 11:51:37 +0000 (13:51 +0200)]
handlers.dispatch: Move grants into sql function

The grants can be loaded via information_schema,
thus no need to do it in Python.

13 years agolondiste: allow whitespace for key in --handler-arg
Marko Kreen [Thu, 29 Dec 2011 15:16:51 +0000 (17:16 +0200)]
londiste: allow whitespace for key in --handler-arg

as we already do it for value, we can aswell do it for key.

13 years agotests/handler: test dispatcher too
Marko Kreen [Thu, 29 Dec 2011 14:26:33 +0000 (16:26 +0200)]
tests/handler: test dispatcher too

13 years agohandlers.dispatch: in case of part-func, apply master grants later
Marko Kreen [Thu, 29 Dec 2011 14:25:32 +0000 (16:25 +0200)]
handlers.dispatch: in case of part-func, apply master grants later

the problem is there is no good way to do it with plpgsql.

13 years agodbstruct: sync acl list with 9.2 git
Marko Kreen [Thu, 29 Dec 2011 14:19:50 +0000 (16:19 +0200)]
dbstruct: sync acl list with 9.2 git

13 years agolondiste.syncer: load per-table handler
Marko Kreen [Thu, 29 Dec 2011 12:55:40 +0000 (14:55 +0200)]
londiste.syncer: load per-table handler

this is preparation for compare/repair for subset of table.

13 years agotgz: update libusual include
Marko Kreen [Thu, 29 Dec 2011 12:35:45 +0000 (14:35 +0200)]
tgz: update libusual include

13 years agoconfig.mak.in: add more replacement vars.
Marko Kreen [Thu, 29 Dec 2011 12:26:27 +0000 (14:26 +0200)]
config.mak.in: add more replacement vars.

they are currently unused in makefiles tho,
but its the first step.

13 years agodbservice: another cleanup
Marko Kreen [Thu, 29 Dec 2011 10:59:54 +0000 (12:59 +0200)]
dbservice: another cleanup

13 years agodbservice: clean unused imports, make rest available on top-level
Marko Kreen [Thu, 29 Dec 2011 10:57:51 +0000 (12:57 +0200)]
dbservice: clean unused imports, make rest available on top-level

13 years agodbservice.TableAPI: cast id to int8
Marko Kreen [Thu, 29 Dec 2011 09:59:44 +0000 (11:59 +0200)]
dbservice.TableAPI: cast id to int8

This makes possible to use prepared plans with tapi.

13 years agoquerybuilder: take type from last ':'
Marko Kreen [Thu, 29 Dec 2011 09:29:31 +0000 (11:29 +0200)]
querybuilder: take type from last ':'

this allows ':' in variable name

13 years agodoc/makefile: simplify sed expression
Marko Kreen [Wed, 28 Dec 2011 20:19:06 +0000 (22:19 +0200)]
doc/makefile: simplify sed expression

older seds dont like ';'

13 years agomakefile: remove subdir dep from python-install
Marko Kreen [Wed, 28 Dec 2011 10:51:39 +0000 (12:51 +0200)]
makefile: remove subdir dep from python-install

otherwise it wont work on machine without postgres

13 years agolondiste add-table: dont check provider tables on root
Marko Kreen [Fri, 23 Dec 2011 21:38:28 +0000 (23:38 +0200)]
londiste add-table: dont check provider tables on root

does not make sense, and creates failure if table
happens to be local=f.

13 years agolondiste.local_show_missing: show local=f on root as missing
Marko Kreen [Fri, 23 Dec 2011 21:37:31 +0000 (23:37 +0200)]
londiste.local_show_missing: show local=f on root as missing

this can happen in merge situations.

13 years agopgq_ext.version(): 3.0.0.2
Marko Kreen [Fri, 23 Dec 2011 12:45:08 +0000 (14:45 +0200)]
pgq_ext.version(): 3.0.0.2

13 years agolondiste.version(): 3.0.0.12
Marko Kreen [Fri, 23 Dec 2011 12:45:08 +0000 (14:45 +0200)]
londiste.version(): 3.0.0.12

13 years agolondiste.get_table_list: If no merge happens return copy_role=NULL
Marko Kreen [Fri, 23 Dec 2011 12:41:51 +0000 (14:41 +0200)]
londiste.get_table_list: If no merge happens return copy_role=NULL

Seems we started to return 'lead' in such case, which turned on
multi-tx copy.  Although it works, it's annoying.

Add regtest for such case.

13 years agolondiste copy: fix after-copy wait
Marko Kreen [Fri, 23 Dec 2011 12:27:27 +0000 (14:27 +0200)]
londiste copy: fix after-copy wait

Wait now on any non-NULL role.

The string changed in .sql but code here was not updated.
But new simpler rule is that role will be NULL it catchup
can proceed.  So follow that.

Also dont do some potentially dangerous operations (lock, drop-fkey)
on follow-up copies.

13 years agotests/merge: make test run again
Marko Kreen [Fri, 23 Dec 2011 09:17:18 +0000 (11:17 +0200)]
tests/merge: make test run again

Now local_add adds table to combined-root too.
Test did not consider that.

13 years agoRefresh libusual, provide ./autogen.sh
Marko Kreen [Thu, 22 Dec 2011 12:04:51 +0000 (14:04 +0200)]
Refresh libusual, provide ./autogen.sh

13 years agolondiste repair: set session role for apply conneciton
Marko Kreen [Thu, 22 Dec 2011 11:33:14 +0000 (13:33 +0200)]
londiste repair: set session role for apply conneciton

otherwise changes cannot be applied

13 years agodbservice.make_record: convert list to pgarray
Marko Kreen [Thu, 22 Dec 2011 11:00:14 +0000 (13:00 +0200)]
dbservice.make_record: convert list to pgarray

This makes the behaviour compatible with 8.3 plpython,
with did not know arrays and returned text strings.

More general solution would be to use urlenc arrays (same key repeats),
except that not general enough - there is no transparent way
to encode lists with 0 and 1 elements.  So caller must always
be aware whether a key is list or not.  Thus no advantages
over this pgarray solution and disadvantaga is incompatibility.

13 years agomake_pgarray(): convert python list to postgres array
Marko Kreen [Thu, 22 Dec 2011 09:16:04 +0000 (11:16 +0200)]
make_pgarray(): convert python list to postgres array

13 years agoSkyLogger: addHandler() compat method
Marko Kreen [Thu, 15 Dec 2011 12:09:00 +0000 (14:09 +0200)]
SkyLogger: addHandler() compat method

13 years agoMerge remote branch 'martino/master'
Marko Kreen [Thu, 15 Dec 2011 08:31:31 +0000 (10:31 +0200)]
Merge remote branch 'martino/master'

13 years agogitignore: add more files
Marko Kreen [Wed, 14 Dec 2011 21:28:42 +0000 (23:28 +0200)]
gitignore: add more files

13 years agopgq_ext: support coop consumers
Marko Kreen [Wed, 14 Dec 2011 20:13:11 +0000 (22:13 +0200)]
pgq_ext: support coop consumers

Add subconsumer_id to all tables and function params.

13 years agopgq_ext: split functions into separate files
Marko Kreen [Wed, 14 Dec 2011 14:53:37 +0000 (16:53 +0200)]
pgq_ext: split functions into separate files

13 years agotests/londiste: test repair
Marko Kreen [Wed, 14 Dec 2011 19:55:25 +0000 (21:55 +0200)]
tests/londiste: test repair

13 years agoMerge branch 'master' of skype-git:/git/dba/skytools-3
martinko [Wed, 14 Dec 2011 17:45:53 +0000 (18:45 +0100)]
Merge branch 'master' of skype-git:/git/dba/skytools-3

13 years agoadded skytools.hashtext module
martinko [Wed, 14 Dec 2011 14:32:55 +0000 (15:32 +0100)]
added skytools.hashtext module

imported from skytools-2.0 (written by marko)

13 years agopgq.version(): 3.0.0.12
Marko Kreen [Wed, 14 Dec 2011 12:52:06 +0000 (14:52 +0200)]
pgq.version(): 3.0.0.12

13 years agopgq.register_consumer_at: if tick is given, drop open batch
Marko Kreen [Wed, 14 Dec 2011 12:48:54 +0000 (14:48 +0200)]
pgq.register_consumer_at: if tick is given, drop open batch

Old behaviour could catch (maybe) some bugs, but made
life hard for consumers that know what they are doing.

Basically, non-NULL tick pos is taken as "consumer knows better".

13 years agolondiste compare: use number of failed tables as exit code
Marko Kreen [Tue, 13 Dec 2011 07:33:00 +0000 (09:33 +0200)]
londiste compare: use number of failed tables as exit code

13 years agohandlers.dispatch: fix part_func usage
Marko Kreen [Fri, 9 Dec 2011 20:26:41 +0000 (22:26 +0200)]
handlers.dispatch: fix part_func usage

13 years agopgq_coop.version(): 3.0.0.3
Marko Kreen [Fri, 9 Dec 2011 09:53:56 +0000 (11:53 +0200)]
pgq_coop.version(): 3.0.0.3

13 years agopgq_coop.next_batch: automatically register subconsumer
Marko Kreen [Fri, 9 Dec 2011 09:53:30 +0000 (11:53 +0200)]
pgq_coop.next_batch: automatically register subconsumer

13 years agolondiste repair: add --apply flag
Marko Kreen [Fri, 9 Dec 2011 08:31:21 +0000 (10:31 +0200)]
londiste repair: add --apply flag

this will auto-apply fixes, instead writing them out.

13 years agolondiste repair: some cleanups
Marko Kreen [Fri, 9 Dec 2011 07:08:14 +0000 (09:08 +0200)]
londiste repair: some cleanups

- get_pkeys, get_columns: use functions from skytools
- replace os.system with subprocess

13 years agolondiste: replace SERIALIZABLE with REPEATABLE_READ
Marko Kreen [Fri, 9 Dec 2011 07:02:37 +0000 (09:02 +0200)]
londiste: replace SERIALIZABLE with REPEATABLE_READ

On < 9.1 they are same.  On 9.1+ REPEATABLE_READ is
same as old SERIALIZABLE, but SERIALIZABLE is rather heavy.

13 years agoskytools: seems psycopg2 isolation constants do change
Marko Kreen [Thu, 8 Dec 2011 16:15:28 +0000 (18:15 +0200)]
skytools: seems psycopg2 isolation constants do change

Psycopg 2.4.2 moved them around.

Stop hard-coding them, instead import from psycopg2.externsions

Also have a symbol for repeatable read.

13 years agopgq_ext.version: more rename
Marko Kreen [Wed, 7 Dec 2011 11:55:17 +0000 (13:55 +0200)]
pgq_ext.version: more rename

13 years agopgq_ext.version: rename to proper file.
Marko Kreen [Wed, 7 Dec 2011 11:53:18 +0000 (13:53 +0200)]
pgq_ext.version: rename to proper file.

13 years agolondiste.version(): 3.0.0.11
Marko Kreen [Wed, 7 Dec 2011 11:52:12 +0000 (13:52 +0200)]
londiste.version(): 3.0.0.11

13 years agopgq_node.version(): 3.0.0.12
Marko Kreen [Wed, 7 Dec 2011 11:52:12 +0000 (13:52 +0200)]
pgq_node.version(): 3.0.0.12

13 years agopgq.version(): 3.0.0.11
Marko Kreen [Wed, 7 Dec 2011 11:52:12 +0000 (13:52 +0200)]
pgq.version(): 3.0.0.11

13 years agopgq_node.drop_node: fix bugs in recent changes
Marko Kreen [Wed, 7 Dec 2011 11:50:47 +0000 (13:50 +0200)]
pgq_node.drop_node: fix bugs in recent changes

Add function to regtests to avoid such problems in future.

13 years agoDBScript: simpler removal of password info
Marko Kreen [Wed, 7 Dec 2011 11:33:30 +0000 (13:33 +0200)]
DBScript: simpler removal of password info

PG connect strings can be quite free-form.
So remove everything after 'password'.

13 years agoskylog: use LoggerAdapter to give .trace method
Marko Kreen [Wed, 7 Dec 2011 11:32:29 +0000 (13:32 +0200)]
skylog: use LoggerAdapter to give .trace method

Replacing the default logger class seems dubious.

13 years agoMerge remote branch 'martino/master'
Marko Kreen [Wed, 7 Dec 2011 10:23:17 +0000 (12:23 +0200)]
Merge remote branch 'martino/master'

13 years agolondiste.handlers.dispatch: make part_func name configurable
Marko Kreen [Wed, 7 Dec 2011 10:17:24 +0000 (12:17 +0200)]
londiste.handlers.dispatch: make part_func name configurable

13 years agolondiste.local_add_table: ignore merge situation if copy is not needed
Marko Kreen [Wed, 7 Dec 2011 10:15:01 +0000 (12:15 +0200)]
londiste.local_add_table: ignore merge situation if copy is not needed

This allows unsyncromized adding in different leafs, with --expect-sync.

No reason to throw error in such case.

13 years agolondiste.local_remove_table: clean table_attrs
Marko Kreen [Wed, 7 Dec 2011 10:14:05 +0000 (12:14 +0200)]
londiste.local_remove_table: clean table_attrs

Still no good idea what to do with dropped_ddl

13 years agoMerge branch 'master' of git://github.com/markokr/skytools
Marko Kreen [Wed, 7 Dec 2011 10:13:11 +0000 (12:13 +0200)]
Merge branch 'master' of git://github.com/markokr/skytools

13 years agoskytools.signal_pidfile: ignore empty pidfile, some cleanups
Marko Kreen [Wed, 7 Dec 2011 10:10:34 +0000 (12:10 +0200)]
skytools.signal_pidfile: ignore empty pidfile, some cleanups

Empty pidfile can happen if old process failed to write it
for some reason.

13 years agoMerge pull request #6 from antiveeranna/master
Marko Kreen [Wed, 7 Dec 2011 10:02:56 +0000 (02:02 -0800)]
Merge pull request #6 from antiveeranna/master

Filter password in connstr before logging it

13 years agoskytools.__init__: alphabetically ordered modules / symbols
martinko [Tue, 6 Dec 2011 15:12:00 +0000 (17:12 +0200)]
skytools.__init__: alphabetically ordered modules / symbols

13 years agoMerge branch 'master' of skype-git:/git/dba/skytools-3
martinko [Tue, 6 Dec 2011 14:48:40 +0000 (16:48 +0200)]
Merge branch 'master' of skype-git:/git/dba/skytools-3

13 years agoskytools.skylog: fixed SkyLogger.trace() vs funcName format attribute
martinko [Tue, 6 Dec 2011 10:31:06 +0000 (12:31 +0200)]
skytools.skylog: fixed SkyLogger.trace() vs funcName format attribute

13 years agofilter potential passwords in connstr before logging it
anti.veeranna [Tue, 6 Dec 2011 08:17:40 +0000 (10:17 +0200)]
filter potential passwords in connstr before logging it

13 years agoreworked custom logging init
martinko [Mon, 5 Dec 2011 16:28:21 +0000 (18:28 +0200)]
reworked custom logging init

SkyLogger is no more installed automatically on scripting.py loading,
rather exlicitly when our custom getLogger() function is called.

13 years agoskylog: add job_name, service_name, hostname to LogRecord
Marko Kreen [Thu, 1 Dec 2011 12:47:09 +0000 (14:47 +0200)]
skylog: add job_name, service_name, hostname to LogRecord

This makes those fields usable everywhere.

As discussed in comment, no better way to do it.

Also remove few per-msg gethostname() calls.

13 years agoskylog.ini: sample for syslog
Marko Kreen [Thu, 1 Dec 2011 12:45:43 +0000 (14:45 +0200)]
skylog.ini: sample for syslog

13 years agosql upgrade cleanup
Marko Kreen [Tue, 29 Nov 2011 14:23:46 +0000 (16:23 +0200)]
sql upgrade cleanup

- use 'structure/upgrade.sql' to generate X.upgrade.sql
- add pgq_ext to upgraded schemas
- move non-standard upgrade scripts to extra/
- setup_skytools: build sql files in 'build' target, not always
- pgq_ext.version: bump ver to 3.0.0.1

13 years agoskytools_upgrade: if schema too old, stop touching it
Marko Kreen [Tue, 29 Nov 2011 13:08:37 +0000 (15:08 +0200)]
skytools_upgrade: if schema too old, stop touching it

13 years agosetup_skytools: install skytools_upgrade.py
Marko Kreen [Tue, 29 Nov 2011 11:15:23 +0000 (13:15 +0200)]
setup_skytools: install skytools_upgrade.py

13 years agoskylog: record.name is not jobname anymore
Marko Kreen [Tue, 29 Nov 2011 09:48:57 +0000 (11:48 +0200)]
skylog: record.name is not jobname anymore

13 years agopgq.register_consumer_at: fix docstring
Marko Kreen [Tue, 29 Nov 2011 09:46:45 +0000 (11:46 +0200)]
pgq.register_consumer_at: fix docstring

13 years agoskytools/scripting.py: added new log level TRACE that is below DEBUG level
martinko [Mon, 28 Nov 2011 17:09:30 +0000 (18:09 +0100)]
skytools/scripting.py: added new log level TRACE that is below DEBUG level

Added new "debug-2" log level that is intended for finer-grained informational events than DEBUG log level.

13 years agoMerge remote-tracking branch 'klando/for_marko'
Marko Kreen [Fri, 25 Nov 2011 14:36:40 +0000 (16:36 +0200)]
Merge remote-tracking branch 'klando/for_marko'

Conflicts:
README

13 years agoREADME: PgQ review
Cédric Villemain [Fri, 25 Nov 2011 13:13:45 +0000 (14:13 +0100)]
README: PgQ review

Improve the PgQ overview and add some sentences from Hannu

13 years agodoc/Makefile: update for walmgr3 and londiste3
Cédric Villemain [Fri, 25 Nov 2011 13:47:28 +0000 (14:47 +0100)]
doc/Makefile: update for walmgr3 and londiste3

so the new file is build and the renamed one is still build

13 years agodoc/londiste3.txt: add londiste3 manpage
Cédric Villemain [Fri, 25 Nov 2011 13:45:08 +0000 (14:45 +0100)]
doc/londiste3.txt: add londiste3 manpage

Up to date with --help
Londiste man page is mostly written, it lacks maybe a QUICK START.

13 years agodoc/qadmin.txt: Update the man page
Cédric Villemain [Thu, 17 Nov 2011 14:59:55 +0000 (15:59 +0100)]
doc/qadmin.txt: Update the man page

The manpage contains now all the options and console commands
as well as not implemented commands.

there are items in the TODO list in the source, what about them in
the documentation ?

13 years agodoc/walmgr.txt: walmgr manpage review
Cédric Villemain [Thu, 17 Nov 2011 12:19:35 +0000 (13:19 +0100)]
doc/walmgr.txt: walmgr manpage review

The review is based on walmgr3 --help output and partial code review.

File has been rename from walmgr.txt

QUICK START reviewed for warm-standby.

13 years agopython/walmngr.py: update help and usage
Cédric Villemain [Thu, 17 Nov 2011 12:14:59 +0000 (13:14 +0100)]
python/walmngr.py: update help and usage

Add the xpartialsync command description and remove the -n switch
from usage (it is already present in --help)

13 years agolondiste.global_add_table: automatically add table to combined node
Marko Kreen [Fri, 25 Nov 2011 13:35:56 +0000 (15:35 +0200)]
londiste.global_add_table: automatically add table to combined node

13 years agosql/londiste: fix comment
Marko Kreen [Fri, 25 Nov 2011 13:35:18 +0000 (15:35 +0200)]
sql/londiste: fix comment

13 years agoskytools_upgrade: support 3.0-upgrades, walk databases
Marko Kreen [Fri, 25 Nov 2011 09:17:18 +0000 (11:17 +0200)]
skytools_upgrade: support 3.0-upgrades, walk databases

13 years agolondiste.handlers.dispatch: mention table name in mismatch warnings
Marko Kreen [Thu, 24 Nov 2011 15:40:57 +0000 (17:40 +0200)]
londiste.handlers.dispatch: mention table name in mismatch warnings

13 years agoskytools.scripting: fix fileConfig on python 2.5
Marko Kreen [Thu, 24 Nov 2011 09:08:54 +0000 (11:08 +0200)]
skytools.scripting: fix fileConfig on python 2.5

There is no disable_existing_loggers argument so
we need manually enable all loggers again.

13 years agoskytools.BaseScript: fix use_skylog vs. module level loggers.
Marko Kreen [Wed, 23 Nov 2011 20:16:05 +0000 (22:16 +0200)]
skytools.BaseScript: fix use_skylog vs. module level loggers.

We want to support loggers initialized on module import time,
but for some reason logging.config.fileConfig() disables all
existing loggers by default.

Set disable_existing_loggers=False when calling to stop such behaviour.

13 years agopgq_node.version(): 3.0.0.11
Marko Kreen [Tue, 22 Nov 2011 14:24:33 +0000 (16:24 +0200)]
pgq_node.version(): 3.0.0.11

13 years agopgq.version(): 3.0.0.10
Marko Kreen [Tue, 22 Nov 2011 14:24:33 +0000 (16:24 +0200)]
pgq.version(): 3.0.0.10

13 years agotodo: few ideas to avoid connstrings on command line
Marko Kreen [Mon, 21 Nov 2011 11:07:25 +0000 (13:07 +0200)]
todo: few ideas to avoid connstrings on command line

13 years agotests: replace 'replay' with 'worker'
Marko Kreen [Mon, 21 Nov 2011 11:06:43 +0000 (13:06 +0200)]
tests: replace 'replay' with 'worker'

13 years agodrop-node: better behaviour when node is down
Marko Kreen [Mon, 21 Nov 2011 11:06:15 +0000 (13:06 +0200)]
drop-node: better behaviour when node is down

13 years agopgq_node.drop_node: refuse to drop if node is our provider.
Marko Kreen [Mon, 21 Nov 2011 10:14:04 +0000 (12:14 +0200)]
pgq_node.drop_node: refuse to drop if node is our provider.

safety check, admin tool should have done change-provider
before dropping.

13 years agolondiste: remove 'replay' alias for 'worker'
Marko Kreen [Fri, 18 Nov 2011 16:27:51 +0000 (18:27 +0200)]
londiste: remove 'replay' alias for 'worker'