From 5bc49101472efd58c03a2d86078ec7bf33ac1ede Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 11 Jan 2012 10:54:59 +0100 Subject: [PATCH] pgq_node.set_global_watermark: fix wm=null check for branch node It was in wrong IF section --- .../functions/pgq_node.set_global_watermark.sql | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sql/pgq_node/functions/pgq_node.set_global_watermark.sql b/sql/pgq_node/functions/pgq_node.set_global_watermark.sql index 9150ad76..d0c7d470 100644 --- a/sql/pgq_node/functions/pgq_node.set_global_watermark.sql +++ b/sql/pgq_node/functions/pgq_node.set_global_watermark.sql @@ -44,10 +44,6 @@ begin if _wm is null then raise exception 'local_watermark=NULL from get_node_info()?'; end if; - elsif i_watermark is null then - select 500, 'bad usage: wm=null on non-root node' - into ret_code, ret_note; - return; end if; -- move watermark @@ -62,6 +58,12 @@ begin where queue_name = i_queue_name and consumer_name = this.worker_name; elsif this.node_type = 'branch' then + if i_watermark is null then + select 500, 'bad usage: wm=null on branch node' + into ret_code, ret_note; + return; + end if; + -- tick can be missing if we are processing -- old batches that set watermark outside -- current range -- 2.39.5