Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfm8r-00D7ir-9f for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Sep 2023 19:00:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qfm8q-002YvV-1Q for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Sep 2023 19:00:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfm8p-002YvJ-He for pgsql-bugs@lists.postgresql.org; Mon, 11 Sep 2023 19:00:11 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qfm8l-004VPE-P1 for pgsql-bugs@postgresql.org; Mon, 11 Sep 2023 19:00:10 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68fc292de9dso1018501b3a.0 for ; Mon, 11 Sep 2023 12:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1694458805; x=1695063605; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=LihS+3KLhrt/h2J1PKR1/XCsjqKdVA+XVqmZdfKGolk=; b=MRWaPRAnvN19JKkE/LWgXmEDrWuhlKy+tWfoYVEbNvnbMscDP99n/3oAVb4KyN8SCE W5e9Nl8Nu6d2+eKNQTJOM26vNUC/cWMHiOxMpJa3E04tHY4tDO4hdjHX/SbWpL0/nI6x GmeJTPUYuEy7Rlxe9ZnFaJeq3ZMTKe3XYn/DfP93Ize3gMVDHIeE2iYrU3krxqInbd3R 2ksxPuw4MtbauLTjKWXRFn1MS80yw5rUL3HWDmF9XMNm6xrcmoyhGDxPLU7nWH7bHCzN war2suEaKB6rV4QQJXp7r7VOVD/N3SEDb7zUGwxrNZN0cyIuv67QS/oaq91thPgUbqHX xd0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694458805; x=1695063605; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=LihS+3KLhrt/h2J1PKR1/XCsjqKdVA+XVqmZdfKGolk=; b=FsRcnnqvGFHqp9bQ3hTI04/tiveBeX2cM19xZNPyYcWLS9ZwuhPjJd58i+JPK9C6Ex LHjcpgaCHXntXj8T1cy7wMhQ27Bm9WSghpyXRmOOgTAsGaJOcxaNVGxdhwpuGuZmaz3b VfytIGNLeZe+Akf+bfzwb+WpwVyJe1Op4HfpuWjN856Iw8B8sflrkcZM8VD9FNjVvGNf ELIx4nHcXdy9fpAMQTl5H1YrR1WB/gUtt9qAskULVbP4brjnsfG50ibdEaR4q5jgupqj e+NLpfLiy//u5US3DorMW2vvl/mdSnxTTRrp6EWB+3iWmCOQnoSXJbdCtTnALmadYrYg Febg== X-Gm-Message-State: AOJu0YxwqniFpi3G+uAAvEvFOGhwJRERm6ZQxyzPmb8oAO8SsBXAVBUq OmaEFwU7EdosbZ6v+r5Hon6E3uklvFgU0bePpAY= X-Google-Smtp-Source: AGHT+IHG+fy9b3F3KR33TAcNTdaI43VruX9YYEFo2cLJEiurJpsnQCAq5KoPuqr0fKzBwGeeJM8iCg== X-Received: by 2002:a05:6a00:4a07:b0:68e:2c2a:5172 with SMTP id do7-20020a056a004a0700b0068e2c2a5172mr427988pfb.6.1694458805022; Mon, 11 Sep 2023 12:00:05 -0700 (PDT) Received: from [172.18.10.24] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id s12-20020aa7828c000000b0063f00898245sm6102767pfm.146.2023.09.11.12.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 12:00:04 -0700 (PDT) Message-ID: <5dff4caf26f45ce224a33a5e18e110b93a351b2f.camel@j-davis.com> Subject: Re: [16+] subscription can end up in inconsistent state From: Jeff Davis To: Amit Kapila Cc: pgsql-bugs@postgresql.org, Robert Haas Date: Mon, 11 Sep 2023 12:00:03 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-09-11 at 08:59 +0530, Amit Kapila wrote: > Can we think of calling walrcv_check_conninfo() when the following > check is true (MySubscription->passwordrequired && > !superuser_arg(MySubscription->owner))? IIUC this has to be done for > both apply_worker and tablesync_worker. To me, it would make sense to just have walrcv_connect() do both checks (a) and (b) -- rather than only check (b) -- when must_use_password is true. Separating these checks (which are really two parts of the same check) led to this problem in the first place. Another thought: we may also need to invalidate the subscription worker in cases where a user loses their superuser status. Regards, Jeff Davis