Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etAiL-0004yR-3q for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Mar 2018 11:25:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1etAiK-0007gG-0r for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Mar 2018 11:25:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etAiJ-0007g5-N0 for pgsql-hackers@lists.postgresql.org; Tue, 06 Mar 2018 11:24:59 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1etAiG-0004q9-M8 for pgsql-hackers@postgresql.org; Tue, 06 Mar 2018 11:24:58 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 7ED2321C1C8C; Tue, 6 Mar 2018 14:24:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail.postgrespro.ru (cyclops.l.postgrespro.ru [192.168.27.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 507A421C1CB6; Tue, 6 Mar 2018 14:24:54 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1520335494; bh=drc7G7qikvssKg7YmkpEM5le/2Hv2BFFw6gPjpJ9nTg=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=c12DoOC6W4HCJtVXPWCq+TitirLlWykK1zKaMAw9MCPslH/lRfboHDpJUC+5Fxosk JOb7AOB14IUBqARSUs1MJeYXhej5yaUidA9dpf95PJyyC8JTFT8UfvyoOM8HPSYFFx TaYTdx98e6X0+JDOZmxHbBR9lHH6EN4x1P9SYjVM= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 06 Mar 2018 14:24:53 +0300 From: Dmitry Ivanov To: Simon Riggs Cc: Ivan Kartyshov , Thomas Munro , PostgreSQL-development Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed Organization: Postgres Professional In-Reply-To: References: <0240c26c-9f84-30ea-fca9-93ab2df5f305@postgrespro.ru> Message-ID: X-Sender: d.ivanov@postgrespro.ru User-Agent: Roundcube Webmail/1.2.4 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > In PG11, I propose the following command, sticking mostly to Ants' > syntax, and allowing to wait for multiple events before it returns. It > doesn't hold snapshot and will not get cancelled by Hot Standby. > > WAIT FOR event [, event ...] options > > event is > LSN value > TIMESTAMP value > > options > TIMEOUT delay > UNTIL TIMESTAMP timestamp > (we have both, so people don't need to do math, they can use whichever > they have) I have a (possibly) dumb question: if we have specified several events, should WAIT finish if only one of them triggered? It's not immediately obvious if we're waiting for ALL of them to trigger, or just one will suffice (ANY). IMO the syntax could be extended to something like: WAIT FOR [ANY | ALL] event [, event ...] options, with ANY being the default variant. -- Dmitry Ivanov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company