projects
/
skytools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d3000e
)
pgq.maint_operations: re-check the need for step2
author
Marko Kreen
<markokr@gmail.com>
Tue, 10 Jan 2012 21:38:30 +0000
(22:38 +0100)
committer
Marko Kreen
<markokr@gmail.com>
Tue, 10 Jan 2012 21:38:30 +0000
(22:38 +0100)
Previously the need for step2 was decided by need for step1.
But if pgqd stops/crashed after step1 but before step2,
the step2 will not be run anymore.
Fix this by rechecking if no step1 was needed.
sql/pgq/functions/pgq.maint_operations.sql
patch
|
blob
|
blame
|
history
diff --git
a/sql/pgq/functions/pgq.maint_operations.sql
b/sql/pgq/functions/pgq.maint_operations.sql
index bb72b12fb31b1501afcc1867c865c2192cd26492..31c44ba3567b871b005c3334008492eaacdac223 100644
(file)
--- a/
sql/pgq/functions/pgq.maint_operations.sql
+++ b/
sql/pgq/functions/pgq.maint_operations.sql
@@
-34,6
+34,12
@@
begin
end loop;
-- rotate step 2
+ if nrot = 0 then
+ select count(1) from pgq.queue
+ where queue_rotation_period is not null
+ and queue_switch_step2 is null
+ into nrot;
+ end if;
if nrot > 0 then
func_name := 'pgq.maint_rotate_tables_step2';
func_arg := NULL;