skytools.git
16 years agopython/pgq update
Marko Kreen [Fri, 13 Feb 2009 12:16:59 +0000 (14:16 +0200)]
python/pgq update

- remove the obsolete setconsumer stuff
- New CascadedConsumer / CascadedWorker classes,
  that are based on regular pgq.Consumer

- move RemoteConsumer / SerialConsumer out of pgq/consumer.py

pgq.Consumer:
- rename conf params and instance variables:
  pgq_queue_name -> queue_name
  pgq_consumer_id -> consumer_name
- disable automatic registration on the queue,
  now script needs to be called with switches --register / --unregister
- drop code to read from multiple-queues at once

pgq.ticker:
- drop event seq tracking code, this is now done in db

16 years agoRewrite sql/londiste for cascading.
Marko Kreen [Fri, 13 Feb 2009 10:49:38 +0000 (12:49 +0200)]
Rewrite sql/londiste for cascading.

Noteworthy changes:
- EXECUTE
- Parallel copy from partitions into single table.
- Sequences are now pushed, instead of pulled.
  Root node will periodically send values with reasonable
  safety-room into queue.

16 years agoRewrite sql/pgq_set as sql/pgq_node
Marko Kreen [Fri, 13 Feb 2009 10:46:44 +0000 (12:46 +0200)]
Rewrite sql/pgq_set as sql/pgq_node

Main change is that there is no 'set' concept anymore.
Everything is queue-based.

16 years agosql/pgq update
Marko Kreen [Fri, 13 Feb 2009 10:29:12 +0000 (12:29 +0200)]
sql/pgq update

structure:
- event_seq field for pgq.tick table, to store last value
  from event_id_seq
- 'disabled' field for pgq.queue, which can disable any
  direct inserts to queue.  inserts are allowed only
  if session_role = 'replica'

functions:

- pgq.next_batch_info() as next_batch() but returns full details
- pgq.ticker(): now contains ticker logic that previously
  was located in python code - it uses the event_seq field
  in tick table to know about last sequence value
- pgq.insert_event_raw() - check disabled flag
- pgq.seq_getval() / pgq.seq_setval() functions for safe
  sequence variable manipulation

- remove denytriga, now regular triggers can play the role
- use OUT parameters instead of ret types
- pgq.force_tick(): silently ignore the request on disabled queues
- pgq.maint_retry_events(): fwd port bugfix from 2.1-stable
- pgq.maint_rotate_tables(): cleanup from 2.1-stable
- pgq.maint_tables_to_vacuum(): add more tables
- triggers/common.c: bugfix from 2.1-stable

16 years agopython/skytools update
Marko Kreen [Fri, 13 Feb 2009 10:03:53 +0000 (12:03 +0200)]
python/skytools update

- docstrings
- some preliminary python 3.0 compat (var names, print())
- sync with 2.1-stable

adminscript:
- move exec_cmd function to dbscript

dbstruct:
- support sequnces.  SERIAL columns are not automatically created,
  but the link beteween column and sequence is.

psycopgwrapper:
- drop support for psycopg1
- beginnings of quick DB-API / DictRow description.

quoting:
- new unquote_fqident() function, reverse of quote_fqident()
- quote_statement() accepts both row and dict

dbscript:
- catch startup errors
- use log.exception for exceptions, will result in nicer logs

sqltools:
- exists_sequence()

_pyquoting:
- fix typo in variable name

16 years agotag the tree as 3.0-git
Marko Kreen [Thu, 12 Feb 2009 14:41:38 +0000 (16:41 +0200)]
tag the tree as 3.0-git

16 years agoIf possible, use %r in restore_command. Based on patch by
Martin Pihlak [Fri, 30 Jan 2009 12:36:55 +0000 (12:36 +0000)]
If possible, use %r in restore_command. Based on patch by
Mark Kirkwood and Omar Kilani.

16 years agofix a crash in master_stop if pidfile not present in config file.
Martin Pihlak [Mon, 26 Jan 2009 21:33:42 +0000 (21:33 +0000)]
fix a crash in master_stop if pidfile not present in config file.
from Mark Kirkwood.

16 years ago- documentation update.
Martin Pihlak [Mon, 26 Jan 2009 13:51:46 +0000 (13:51 +0000)]
- documentation update.
- upgraded configuration to use 8.3

16 years agobugfix for archive_mode detection.
Martin Pihlak [Thu, 22 Jan 2009 18:25:41 +0000 (18:25 +0000)]
bugfix for archive_mode detection.

16 years ago- improved archive_mode handling, loosely based on patch by Mark Kirkwood
Martin Pihlak [Thu, 22 Jan 2009 17:46:27 +0000 (17:46 +0000)]
- improved archive_mode handling, loosely based on patch by Mark Kirkwood
- replaced os.system with exec_system, that pays attention to 'not_really'
- separate class for the configuration modifier

16 years agoskytools.DBScript: better pidfile handling (from 2.2)
Marko Kreen [Thu, 8 Jan 2009 20:14:16 +0000 (20:14 +0000)]
skytools.DBScript: better pidfile handling (from 2.2)

16 years agoskytools.full_copy(): quoting, copy_expert (from 2.2)
Marko Kreen [Thu, 8 Jan 2009 20:09:05 +0000 (20:09 +0000)]
skytools.full_copy(): quoting, copy_expert (from 2.2)

16 years agoskytools.magic_insert: quoting, work on DictRow
Marko Kreen [Thu, 8 Jan 2009 20:03:03 +0000 (20:03 +0000)]
skytools.magic_insert: quoting, work on DictRow

16 years agoskytools.quote_statement: accept arg list (from 2.2)
Marko Kreen [Thu, 8 Jan 2009 19:59:11 +0000 (19:59 +0000)]
skytools.quote_statement: accept arg list (from 2.2)

16 years agoskytools.dbstruct: import quoting from 2.2 branch
Marko Kreen [Thu, 8 Jan 2009 19:56:00 +0000 (19:56 +0000)]
skytools.dbstruct: import quoting from 2.2 branch

16 years agoFix cquoting crash with Decimal() type.
Marko Kreen [Mon, 29 Dec 2008 16:43:27 +0000 (16:43 +0000)]
Fix cquoting crash with Decimal() type.

Seems there can be types which have buffer operations struct,
but no function pointers.  So check also for called functions.

16 years agoWalMgr changes:
Martin Pihlak [Fri, 28 Nov 2008 13:27:38 +0000 (13:27 +0000)]
WalMgr changes:
- Added recovery restart point handling, retain WAL files since the last
  restart point. Additional slave config parameter "slave_bin" for specifying
  location for postgres binaries.
- Slave backup now creates backup_label and history files.

17 years ago- s/self.jobs/jobs/ in "reload"
Martin Pihlak [Wed, 17 Sep 2008 10:48:19 +0000 (10:48 +0000)]
- s/self.jobs/jobs/ in "reload"
- fix "start" error message when job is already running

17 years agoproper quoting for dispatcher scripts
Marko Kreen [Wed, 17 Sep 2008 10:37:50 +0000 (10:37 +0000)]
proper quoting for dispatcher scripts

17 years ago- improved error messages on startup if no config file specified.
Martin Pihlak [Fri, 20 Jun 2008 08:05:58 +0000 (08:05 +0000)]
- improved error messages on startup if no config file specified.
- walmgr.py stop now also stops syncdaemon
- pg_auth file is copied to slave as part of archiving. restored during boot.
- cleanup in remote_walmgr() to always pass config file to slave walmgr.
- master_backup() now reports exceptions.

17 years agoimport typo fix from -stable, restore stat_add
Marko Kreen [Wed, 18 Jun 2008 09:17:00 +0000 (09:17 +0000)]
import typo fix from -stable, restore stat_add
to keep the differences minimal

17 years agoDBScript.stat_add - keep the old function for compat
Marko Kreen [Wed, 18 Jun 2008 09:15:50 +0000 (09:15 +0000)]
DBScript.stat_add - keep the old function for compat

17 years agoadd new files
Marko Kreen [Wed, 30 Apr 2008 14:28:42 +0000 (14:28 +0000)]
add new files

17 years agocascading work:
Marko Kreen [Wed, 30 Apr 2008 14:24:01 +0000 (14:24 +0000)]
cascading work:

- let AdminScript detect number of args by introspection
- track event_id_seq downstream
- on rename update subscribers too
- slightly more fleshed out switchover

17 years agoPostgres 8.0.x requires <utils/hsearch.h> for oid_hash.
Marko Kreen [Wed, 30 Apr 2008 14:20:22 +0000 (14:20 +0000)]
Postgres 8.0.x requires <utils/hsearch.h> for oid_hash.

Per report by Marcin Stępnicki

17 years agotest/londiste: create sys dir if not exists
Marko Kreen [Wed, 30 Apr 2008 14:18:55 +0000 (14:18 +0000)]
test/londiste: create sys dir if not exists

17 years agoset tags as phony target
Marko Kreen [Wed, 30 Apr 2008 14:17:26 +0000 (14:17 +0000)]
set tags as phony target

17 years agopgq_set: pause/resume/change-provider/rename-node work now
Marko Kreen [Fri, 25 Apr 2008 14:48:32 +0000 (14:48 +0000)]
pgq_set: pause/resume/change-provider/rename-node work now

17 years agoskytools.quote_statement(): support list/tuple args too
Marko Kreen [Fri, 25 Apr 2008 14:45:53 +0000 (14:45 +0000)]
skytools.quote_statement(): support list/tuple args too

17 years agodoc update
Marko Kreen [Fri, 25 Apr 2008 14:42:51 +0000 (14:42 +0000)]
doc update

17 years agotests/londiste: clean sys dir more
Marko Kreen [Wed, 23 Apr 2008 15:12:27 +0000 (15:12 +0000)]
tests/londiste: clean sys dir more

17 years agosql/pgq: convert pgq.get_batch_info() to use out parameters
Marko Kreen [Wed, 23 Apr 2008 15:11:58 +0000 (15:11 +0000)]
sql/pgq: convert pgq.get_batch_info() to use out parameters

17 years agopython/pgq: more set work
Marko Kreen [Wed, 23 Apr 2008 15:07:04 +0000 (15:07 +0000)]
python/pgq: more set work

- use worker_name == node_name
- make status command show lag
- pass root tick_time downstream

17 years agosql/pgq_set: remove explicit node worker name, it will be equal to node_name
Marko Kreen [Wed, 23 Apr 2008 15:04:10 +0000 (15:04 +0000)]
sql/pgq_set: remove explicit node worker name, it will be equal to node_name

17 years agosql/pgq: allow external ticker to specify tick_time
Marko Kreen [Wed, 23 Apr 2008 15:01:09 +0000 (15:01 +0000)]
sql/pgq: allow external ticker to specify tick_time

17 years agopgq.event: forgot to export EV_UNTAGGED
Marko Kreen [Wed, 23 Apr 2008 15:00:11 +0000 (15:00 +0000)]
pgq.event: forgot to export EV_UNTAGGED

17 years agoforgot couple files
Marko Kreen [Tue, 22 Apr 2008 12:57:22 +0000 (12:57 +0000)]
forgot couple files

17 years agomore pgq_set/londiste cleanup
Marko Kreen [Tue, 22 Apr 2008 12:46:13 +0000 (12:46 +0000)]
more pgq_set/londiste cleanup

17 years agopgq.Consumer - complain on untagged events, instead of sending them to retry queue
Marko Kreen [Tue, 22 Apr 2008 12:45:35 +0000 (12:45 +0000)]
pgq.Consumer - complain on untagged events, instead of sending them to retry queue

17 years agoparse_logtriga_sql - epydoc complained on bad docstring
Marko Kreen [Tue, 22 Apr 2008 12:44:08 +0000 (12:44 +0000)]
parse_logtriga_sql - epydoc complained on bad docstring

17 years agomove common db patterns to skytools.adminscript module
Marko Kreen [Tue, 22 Apr 2008 12:42:47 +0000 (12:42 +0000)]
move common db patterns to skytools.adminscript module

17 years agopython: rework imports to get better docs...
Marko Kreen [Tue, 22 Apr 2008 12:41:05 +0000 (12:41 +0000)]
python: rework imports to get better docs...

17 years agodoc/Makefile: use standard epydoc launcher
Marko Kreen [Tue, 22 Apr 2008 12:39:18 +0000 (12:39 +0000)]
doc/Makefile: use standard epydoc launcher

17 years agomake tags file for python
Marko Kreen [Tue, 22 Apr 2008 12:38:31 +0000 (12:38 +0000)]
make tags file for python

17 years agofix retry/failed event handling in pgq.Consumer
Marko Kreen [Thu, 17 Apr 2008 13:23:19 +0000 (13:23 +0000)]
fix retry/failed event handling in pgq.Consumer

17 years agomore londiste work
Marko Kreen [Thu, 17 Apr 2008 09:22:06 +0000 (09:22 +0000)]
more londiste work

- parallel copy
- dont error out in 'copy' when columns differ - its add-table problem
- test big cascade with lot of tables

17 years agotodo update
Marko Kreen [Thu, 17 Apr 2008 09:20:12 +0000 (09:20 +0000)]
todo update

17 years agodont log so excessively
Marko Kreen [Thu, 17 Apr 2008 09:19:42 +0000 (09:19 +0000)]
dont log so excessively

17 years agoforget db completely on close_database() to allow location change
Marko Kreen [Thu, 17 Apr 2008 09:19:13 +0000 (09:19 +0000)]
forget db completely on close_database() to allow location change

17 years agofix more bugs - stats, trigger type
Marko Kreen [Wed, 16 Apr 2008 09:55:41 +0000 (09:55 +0000)]
fix more bugs - stats, trigger type

17 years agotodo update
Marko Kreen [Tue, 15 Apr 2008 13:11:08 +0000 (13:11 +0000)]
todo update

17 years agowrong file
Marko Kreen [Tue, 15 Apr 2008 13:03:46 +0000 (13:03 +0000)]
wrong file

17 years agomore setconsumer/londiste work.
Marko Kreen [Tue, 15 Apr 2008 13:02:47 +0000 (13:02 +0000)]
more setconsumer/londiste work.

simple init/event processing/copy seems to work.

17 years agoUse $(MAKE) consistently instead of plain 'make'.
Marko Kreen [Tue, 15 Apr 2008 06:24:22 +0000 (06:24 +0000)]
Use $(MAKE) consistently instead of plain 'make'.

Patch by Pierre-Emmanuel André

17 years agodrop support for psycopg1
Marko Kreen [Fri, 11 Apr 2008 13:58:31 +0000 (13:58 +0000)]
drop support for psycopg1

17 years agofix root notifications
Marko Kreen [Fri, 11 Apr 2008 13:54:09 +0000 (13:54 +0000)]
fix root notifications

17 years agosend events
Marko Kreen [Fri, 11 Apr 2008 13:41:34 +0000 (13:41 +0000)]
send events

17 years agouse empty DESTDIR
Marko Kreen [Fri, 11 Apr 2008 12:34:13 +0000 (12:34 +0000)]
use empty DESTDIR

17 years agomore test
Marko Kreen [Fri, 11 Apr 2008 12:33:14 +0000 (12:33 +0000)]
more test

17 years agotxid: install dummy empty txid.sql on 8.3
Marko Kreen [Fri, 11 Apr 2008 12:32:10 +0000 (12:32 +0000)]
txid: install dummy empty txid.sql on 8.3

17 years agoset registration functions
Marko Kreen [Fri, 11 Apr 2008 12:28:28 +0000 (12:28 +0000)]
set registration functions

17 years agotriggers kinda work
Marko Kreen [Fri, 11 Apr 2008 12:27:38 +0000 (12:27 +0000)]
triggers kinda work

17 years agopgq.denytriga - simple deny trigger
Marko Kreen [Fri, 11 Apr 2008 12:24:47 +0000 (12:24 +0000)]
pgq.denytriga - simple deny trigger

17 years agoremove debug print
Marko Kreen [Mon, 7 Apr 2008 07:01:12 +0000 (07:01 +0000)]
remove debug print

17 years agoproper messages, fq name
Marko Kreen [Sat, 5 Apr 2008 17:37:19 +0000 (17:37 +0000)]
proper messages, fq name

17 years agonew file
Marko Kreen [Sat, 5 Apr 2008 17:25:22 +0000 (17:25 +0000)]
new file

17 years agofix record SELECT, allow NULL column
Marko Kreen [Sat, 5 Apr 2008 17:25:07 +0000 (17:25 +0000)]
fix record SELECT, allow NULL column

17 years agomissing file
Marko Kreen [Sat, 5 Apr 2008 17:06:36 +0000 (17:06 +0000)]
missing file

17 years agotiny fixes
Marko Kreen [Fri, 4 Apr 2008 20:26:11 +0000 (20:26 +0000)]
tiny fixes

17 years agoAUTHORS update from -stable
Marko Kreen [Fri, 4 Apr 2008 18:34:43 +0000 (18:34 +0000)]
AUTHORS update from -stable

17 years agotodo update
Marko Kreen [Fri, 4 Apr 2008 18:34:01 +0000 (18:34 +0000)]
todo update

17 years agomore admin work
Marko Kreen [Fri, 4 Apr 2008 18:16:21 +0000 (18:16 +0000)]
more admin work

17 years agorename ProviderSetup to LondisteSetup
Marko Kreen [Fri, 4 Apr 2008 09:12:06 +0000 (09:12 +0000)]
rename ProviderSetup to LondisteSetup

17 years agoCouple fixes for 'walmgr restore' from -stable:
Marko Kreen [Fri, 4 Apr 2008 09:11:01 +0000 (09:11 +0000)]
Couple fixes for 'walmgr restore' from -stable:

- Make sure pg_tblspc exists, 8.3 seems to require it
- Copy config files/symlinks from old data dir over

Original patch by Zoltán Böszörményi, applied with minor rework

17 years agoclarify var names
Marko Kreen [Fri, 4 Apr 2008 09:08:43 +0000 (09:08 +0000)]
clarify var names

17 years agosetconsumer conversion, copy fix from -stable
Marko Kreen [Fri, 4 Apr 2008 09:03:19 +0000 (09:03 +0000)]
setconsumer conversion, copy fix from -stable

17 years agonew londiste wrapper
Marko Kreen [Fri, 4 Apr 2008 09:02:08 +0000 (09:02 +0000)]
new londiste wrapper

17 years agomake fkeys work
Marko Kreen [Thu, 3 Apr 2008 09:29:39 +0000 (09:29 +0000)]
make fkeys work

17 years agosimplify psycopgwrapper:
Marko Kreen [Thu, 3 Apr 2008 09:11:14 +0000 (09:11 +0000)]
simplify psycopgwrapper:

- remove QuotedString, its unused now
- drop the ugly __setitem__ implementation
- drop __setattr__, __delattr_

row is supposed to be r/o

17 years agodollar quoting
Marko Kreen [Thu, 3 Apr 2008 09:00:27 +0000 (09:00 +0000)]
dollar quoting

17 years agoimport fixes
Marko Kreen [Thu, 3 Apr 2008 08:59:58 +0000 (08:59 +0000)]
import fixes

17 years agodetect postgres death in recovery
Marko Kreen [Thu, 13 Mar 2008 14:50:33 +0000 (14:50 +0000)]
detect postgres death in recovery

17 years agowalmgr: Detect stale pidfile by doing kill(pid, 0) to see if process exists.
Marko Kreen [Wed, 12 Mar 2008 16:19:29 +0000 (16:19 +0000)]
walmgr: Detect stale pidfile by doing kill(pid, 0) to see if process exists.

Patch by Charles Duffy

17 years agoslight comments cleanup
Marko Kreen [Wed, 12 Mar 2008 12:50:56 +0000 (12:50 +0000)]
slight comments cleanup

17 years agoFix bugs in previous commit.
Marko Kreen [Tue, 11 Mar 2008 20:47:24 +0000 (20:47 +0000)]
Fix bugs in previous commit.

17 years agovery experimental row.col access, add __slots__
Marko Kreen [Tue, 11 Mar 2008 16:25:15 +0000 (16:25 +0000)]
very experimental row.col access, add __slots__

17 years agonew tokenizer that handles quotes properly, use it everywhere
Marko Kreen [Tue, 11 Mar 2008 16:20:26 +0000 (16:20 +0000)]
new tokenizer that handles quotes properly, use it everywhere

17 years agounquote_ident() + unquote_literal()
Marko Kreen [Tue, 11 Mar 2008 16:17:07 +0000 (16:17 +0000)]
unquote_ident() + unquote_literal()

17 years agorefresh regtests
Marko Kreen [Mon, 10 Mar 2008 08:06:01 +0000 (08:06 +0000)]
refresh regtests

17 years agounfinished londiste reorg, backup commit
Marko Kreen [Fri, 7 Mar 2008 16:53:06 +0000 (16:53 +0000)]
unfinished londiste reorg, backup commit

17 years agouse E quoting if backslash appears
Marko Kreen [Fri, 7 Mar 2008 16:48:32 +0000 (16:48 +0000)]
use E quoting if backslash appears

17 years agopgq/triggers: allow making backup of old row in ev_extra2
Marko Kreen [Fri, 7 Mar 2008 16:47:46 +0000 (16:47 +0000)]
pgq/triggers: allow making backup of old row in ev_extra2

also clean up some common code

17 years agouse E quoting in sql triggers
Marko Kreen [Fri, 7 Mar 2008 15:18:47 +0000 (15:18 +0000)]
use E quoting in sql triggers

17 years agosqltools: experimental code - dbdict, mk_*_sql
Marko Kreen [Thu, 6 Mar 2008 21:24:01 +0000 (21:24 +0000)]
sqltools: experimental code - dbdict, mk_*_sql

17 years agoquoting.py: remove unnecessary urllib import
Marko Kreen [Thu, 6 Mar 2008 21:19:00 +0000 (21:19 +0000)]
quoting.py: remove unnecessary urllib import

17 years agosql/pgq/Makefile: explicit file list
Marko Kreen [Mon, 3 Mar 2008 16:04:05 +0000 (16:04 +0000)]
sql/pgq/Makefile: explicit file list

17 years agopgq/triggers/common.h: reorder fields, comment them
Marko Kreen [Mon, 3 Mar 2008 16:03:08 +0000 (16:03 +0000)]
pgq/triggers/common.h: reorder fields, comment them

17 years agopgq/lowlevel: fix error messages
Marko Kreen [Mon, 3 Mar 2008 16:02:34 +0000 (16:02 +0000)]
pgq/lowlevel: fix error messages

17 years agopgq_set: is_root() functions
Marko Kreen [Mon, 3 Mar 2008 16:00:20 +0000 (16:00 +0000)]
pgq_set: is_root() functions