Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1myhZe-000350-3o for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Dec 2021 21:49:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1myhZ5-0004fw-Os for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Dec 2021 21:48:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1myhZ5-0004fn-4h for pgsql-hackers@lists.postgresql.org; Sat, 18 Dec 2021 21:48:27 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1myhYx-00021Q-Oy for pgsql-hackers@lists.postgresql.org; Sat, 18 Dec 2021 21:48:25 +0000 Received: by mail-ed1-x52e.google.com with SMTP id z5so22089167edd.3 for ; Sat, 18 Dec 2021 13:48:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Gox++bBVYDmEMnfHa+a6M3hy3Ws9xS2J+d6ifI44ouc=; b=BJIO5vpvK5OG5T+uaJme96t+GNdB6qO85VNDqSj1jvZeb5v7OlypkoG8iaEfbupf/v kQyoV1TxSKUPBoiJabiZkbauJ8AuSH/hZPG4MRiYLlZGCbdWOB9TBwoiE/h5o2JGsp2b UH/QRpTx4O/ZTW29zR6rRBDPpAfIetMJBCGC9cBZ7ES2731vC37uVCcXorzaeYytVQgd lFX8IwD0m0rt37+JjkfpoC248XCjEbKaGVb1tplqj15wvKMNgb5kmpxdpAlst5dPKyRf RVFc7nTnxEZ6T2lYgdRxrANSXsgSSCeMcit/SMnj1y1HNEwXCgE1WypYOI6th/HCJ0Dy /KNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Gox++bBVYDmEMnfHa+a6M3hy3Ws9xS2J+d6ifI44ouc=; b=yqX/voYThRt+6AKfLSvWtB9TaGiVtKHSaUIbWSg+thA06Obyk7KUM4LGu7XMOL6TkX KW398H9F6CR+37TL3f1QgFm6zgu2Ej5WwqN9VFPTLROHa6QPTytVBOLHiscL0BM1wuo0 hJeCf4Bm5ey4Hyf/Fr+HADlshfbh7DeesabGzGotPBIeoUlsYEmMv3H1Nc9XhQxPoXXm zKLrzADhn9kUZafxvEyVO487/h+orYcnhcu+XAQdkJxp6Jn3sTmaCNM2dMSEsoKu/VmX 1TQy4iBTf1cMoSfHGKPjZK34M2ortKmamY+CnNSAiXhPBeA6T9Yton4aJ1G0mOv99WRc UPyQ== X-Gm-Message-State: AOAM5323t8u83h348ZgE4gvnZtN4SpLzvMi/Ojp394aDil2Y3Nn3v8KS SW/lDqPzKeEF7XZWTniAgKPoxikpN6W7jQF52MIUUKZ6AUaJGhuCdXlPDCV1vghxG4aeZ7twCyE mQT3giD/ATuCe/4QDO8mmc/dghotdap89hmcJCzLn+SrI6LJykMnO8TpzzD0DgKw0Tb3/Z1ftMv lVlRTNJIBpAaiMwB0Xgnp4YdZXPXWDEi/L+kP1Kmrf/G8HFkmEwYha X-Google-Smtp-Source: ABdhPJxxWovpNdN2RRI3nvMhN0X9A6Raxl7xmlwlfxq43k+iCZiZpCQhzrkbmtADMk/eYgYqEnJhWA== X-Received: by 2002:aa7:dd13:: with SMTP id i19mr4613761edv.351.1639864097337; Sat, 18 Dec 2021 13:48:17 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id go39sm822659ejc.77.2021.12.18.13.48.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Dec 2021 13:48:16 -0800 (PST) Message-ID: <8e24a470-b092-3c9f-0614-acd9df3f724f@enterprisedb.com> Date: Sat, 18 Dec 2021 22:48:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: sequences vs. synchronous replication Content-Language: en-US To: Tom Lane Cc: PostgreSQL Hackers References: <712cad46-a9c8-1389-aef8-faf0203c9be9@enterprisedb.com> <1452362.1639803168@sss.pgh.pa.us> <38a6a779-ee8d-de3c-fbd7-709285be88fa@enterprisedb.com> <7869761b-fdc7-6f7d-dc95-9ba8315a8ecf@enterprisedb.com> <1637476.1639862832@sss.pgh.pa.us> From: Tomas Vondra In-Reply-To: <1637476.1639862832@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/18/21 22:27, Tom Lane wrote: > Tomas Vondra writes: >> Here's a PoC demonstrating this idea. I'm not convinced it's the right >> way to deal with this - it surely seems more like a duct tape fix than a >> clean solution. But it does the trick. > > I was imagining something a whole lot simpler, like "don't try to > cache unused sequence numbers when wal_level > minimal". We've > accepted worse performance hits in that operating mode, and it'd > fix a number of user complaints we've seen about weird sequence > behavior on standbys. > What do you mean by "not caching unused sequence numbers"? Reducing SEQ_LOG_VALS to 1, i.e. WAL-logging every sequence increment? That'd work, but I wonder how significant the impact will be. It'd bet it hurts the patch adding logical decoding of sequences quite a bit. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company