projects
/
skytools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
508dae9
)
pgq.maint_rotate_tables: check txid sanity, fail if bad
author
Marko Kreen
<markokr@gmail.com>
Fri, 15 Jun 2012 13:53:34 +0000
(16:53 +0300)
committer
Marko Kreen
<markokr@gmail.com>
Fri, 15 Jun 2012 13:53:34 +0000
(16:53 +0300)
sql/pgq/functions/pgq.maint_rotate_tables.sql
patch
|
blob
|
blame
|
history
diff --git
a/sql/pgq/functions/pgq.maint_rotate_tables.sql
b/sql/pgq/functions/pgq.maint_rotate_tables.sql
index d972a04edddf5e2633fc9e47925e567d2b854934..d3cee7394bc705af156716607135658968eee76b 100644
(file)
--- a/
sql/pgq/functions/pgq.maint_rotate_tables.sql
+++ b/
sql/pgq/functions/pgq.maint_rotate_tables.sql
@@
-30,6
+30,12
@@
begin
return 0;
end if;
+ -- if DB is in invalid state, stop
+ if txid_current() < cf.queue_switch_step1 then
+ raise exception 'queue % maint failure: step1=%, current=%',
+ i_queue_name, cf.queue_switch_step1, txid_current();
+ end if;
+
-- find lowest tick for that queue
select min(sub_last_tick) into lowest_tick_id
from pgq.subscription