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 1mx7jH-0008UG-FS for pgsql-general@arkaria.postgresql.org; Tue, 14 Dec 2021 13:20:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mx7jE-0006q8-Rz for pgsql-general@arkaria.postgresql.org; Tue, 14 Dec 2021 13:20:24 +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 1mx7jE-0006ps-Ff for pgsql-general@lists.postgresql.org; Tue, 14 Dec 2021 13:20:24 +0000 Received: from mail-ua1-x935.google.com ([2607:f8b0:4864:20::935]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mx7jB-00072j-C3 for pgsql-general@lists.postgresql.org; Tue, 14 Dec 2021 13:20:23 +0000 Received: by mail-ua1-x935.google.com with SMTP id p2so34714336uad.11 for ; Tue, 14 Dec 2021 05:20:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=epv/RRnLTSWOkf6KiP91WfhS0bhGGiWeSI7rOeOBID0=; b=CwEx/BR7fAefvQ5+e1POrVuZPZtiiVPABXVKb/UxiJSGHsZFjf3MqQxx6pHNnWzeKh K2H2iPJlfndJ6nDynIvoCI3PDndA/P/TqORXXs2Yw7GaH/hni+f9wWhT1/a2Ws8lG0nK TybMleZhYMfk7wQb3fRmckEo2N2ksiSjiBR+qiF0XWmLE36gn6VVtDvd6os0m1v+PW0w 8cAX+vLT3igZceOmeSbD9stM4S4yos7j5wHmlUNDN8B9QwJmPalhSTkEoGJl90fyQJoB GvoHBYqmFiLf7W3LiIG/hF55172oPL618tXvqdgnxfHZq+3PvJEypLjbES4qFwVyW1GR sFnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=epv/RRnLTSWOkf6KiP91WfhS0bhGGiWeSI7rOeOBID0=; b=5nCN+cbexDOD2CG4ubhVAxcdKEtMH3EBZ+rplN3lGHIYvbcXM9H+T+5o7fMzo5rvJ1 hTMEDjUIz3c4xecXljs44xup7fhh2v1ZgtYY4H39jU8yrqHFGRSBQVHKRVzcHqbvadUr euLQ06deQA2EfY6EZgmn+zNAKctlsOyJT/ttDHR2xPoqnYGqCQQoK80WwpNcblSz4j9m ko2Z/NBIFqVY4hWXgtL+IgwtDSXFF2T0WW18/dlJimYSticU4jHa4Glad+LWeQpsKgBF /YL7lVqAztGWAx11+7FvkDeT+Y1+9eo3oYTx2OTO0FQ6AKazgvKoi8ERecUTTUQfgWYW I/4w== X-Gm-Message-State: AOAM532OqviRBXgftzSqiO7ZEnit5BRon8UUOQ0yXIwU/5SHizdAqRRT VXybhJ7lhshVsPywfSMekaDm94SIkYL6Z4rOkns= X-Google-Smtp-Source: ABdhPJzE++7khBB3rotN5boVeKySwQszdbFSIXfaAZONVJwVTUSyCddvw3iM+uVDIysKEpUEPD92IeDGv/asO9yV4Z4= X-Received: by 2002:ab0:3349:: with SMTP id h9mr5217329uap.111.1639488020021; Tue, 14 Dec 2021 05:20:20 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a59:d7c7:0:b0:262:cad2:45af with HTTP; Tue, 14 Dec 2021 05:20:19 -0800 (PST) In-Reply-To: References: From: "David G. Johnston" Date: Tue, 14 Dec 2021 06:20:19 -0700 Message-ID: Subject: Re: locks within select To: Marc Millas Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000000c04c705d31b0dab" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000c04c705d31b0dab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, December 14, 2021, Marc Millas wrote: > > > So, if its not a locking scheme, what can block hundreds of transaction t= o > get to the secondary ??? > The transactions are present on the secondary. It just realizes that applying them may cause problems (think drop table or truncate) and so it chooses not to until local queries have completed. Since WAL is strictly linear all sessions are affected. There is no locking needed, or IIUC even possible, and MVCC is not applicable as it only concerns itself with the behavior lf the writable primary system. I suspect there are better attempts at describing this than my half-conscious effort here, though I=E2=80=99ve captured the crux of it - s= treaming WAL is its own unique thing. David J. --0000000000000c04c705d31b0dab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, December 14, 2021, Marc Millas <marc.millas@mokadb.com> wrote:

So, if its=C2=A0not a locking s= cheme, what can block hundreds of transaction to get to the secondary ???

The transactions are present on = the secondary.=C2=A0 It just realizes that applying them may cause problems= (think drop table or truncate) and so it chooses not to until local querie= s have completed.=C2=A0 Since WAL is strictly linear all sessions are affec= ted.=C2=A0 There is no locking needed, or IIUC even possible, and MVCC is n= ot applicable as it only concerns itself with the behavior lf the writable = primary system.

I suspect there are better attempt= s at describing this than my half-conscious effort here, though I=E2=80=99v= e captured the crux of it - streaming WAL is its own unique thing.

David J.

--0000000000000c04c705d31b0dab--