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 1rQiBg-00368d-GD for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Jan 2024 06:17:09 +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 1rQiBf-007Slm-G3 for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Jan 2024 06:17:07 +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 1rQiBf-007Sld-6J for pgsql-hackers@lists.postgresql.org; Fri, 19 Jan 2024 06:17:07 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rQiBc-002aeu-Fi for pgsql-hackers@postgresql.org; Fri, 19 Jan 2024 06:17:06 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e86a9fbd9so4294345e9.1 for ; Thu, 18 Jan 2024 22:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705645023; x=1706249823; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NFkULxFHhqIh+HxU9/QPodHdDeeMCg+egCA9XSNZxKg=; b=cmQV7CmeEZIfgXqBqVmb92YeVgnFcMfm5UFWvfj0ZOMwMTS+TG+XRSjbyJvopcJuIH rozEuu7DaUYtZYtybMEmmRMFYMddKZiSorZD+paLghR0TMC2iditg/h+rMydvn8cUvzA iGaasOrtwO2x43KGNyDbbxFcWghEnYOSiLYXqje2Wb8bVYoMNzuLON3zARKF5alTHZ9J fNJM5lJfx2AHREefB41GnUWc39MIjHrbh4/EeHwpDGEBxb0A5StXns+pTzbSLF+Nvbrb FVLHw3A8AwLrDw8MH7vKGprCJamO1OnQLXjRHHh2b9QJnjmpxum7f/AnaPg/Hu6iPdRb z4Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705645023; x=1706249823; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NFkULxFHhqIh+HxU9/QPodHdDeeMCg+egCA9XSNZxKg=; b=VabLcIUk0WuQxU2xrh48EQHAKVjnEvh/kV6D50h6d2JRctmYkTqqH+MXgAh52kZjfU +iKOJAohuQP9RksIladMUbfYsUkwIgIdBza8WVkL5Axl7p1wtnQhu44inMFrFW71ucMQ hixJuJnYtrP8EStJAulXfKyV1/ey+2KNAloluk0nv4IHL2TvuPw1kegNKrUYPU2iOPHL vTWUR4fD90/1YozW6S2fHcMUdo+UxM8FzfNnblmewyvAI5nx9124JYCIiDbtOlZCigKd M9wRTB37bZmVJz3jz/VbpDfXqDKAuBb2eg5g6tPDZIm8D856bB8xl/gWFSu2kPf30F+S e8Sg== X-Gm-Message-State: AOJu0YwgRW857hCbSrjwD/A9//4/VLerdzuco/V1g8T+q2JkVZgTyhI8 TfXdFHRHeCdHvfqYgfgCeu8WAhCaJrN7DRBA1JHiZGJkDzYcgV06KhEqiC/YmkkLR75HUrytM7E VPoBpspkgHyRuDxZ4yGVqtaKDDnQ= X-Google-Smtp-Source: AGHT+IGaX1Diy9bRe53LEy7SZg8ActI56Cda2obdkKpQfVoOWz1T8INuv2vRXpr62PHWfRc2jWrAdijWks20T/Fkh7g= X-Received: by 2002:a05:600c:18a5:b0:40e:45c0:ad66 with SMTP id x37-20020a05600c18a500b0040e45c0ad66mr1127534wmp.175.1705645022916; Thu, 18 Jan 2024 22:17:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Fri, 19 Jan 2024 11:46:51 +0530 Message-ID: Subject: Re: Synchronizing slots from primary to standby To: Amit Kapila Cc: Bertrand Drouvot , Masahiko Sawada , "Zhijie Hou (Fujitsu)" , Dilip Kumar , Peter Smith , Nisha Moond , "Hayato Kuroda (Fujitsu)" , Bharath Rupireddy , Peter Eisentraut , Bruce Momjian , Ashutosh Sharma , Andres Freund , pgsql-hackers , Ajin Cherian , Alvaro Herrera , shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 19, 2024 at 11:23=E2=80=AFAM Amit Kapila wrote: > > > > 5 =3D=3D=3D (coming from v62-0002) > > > + Assert(tuplestore_tuple_count(res->tuplestore) =3D=3D 1); > > > > > > Is it even possible for the related query to not return only one row?= (I think the > > > "count" ensures it). > > > > I think you are right. This assertion was added sometime back on the > > basis of feedback on hackers. Let me review that again. I can consider > > this comment in the next version. > > > > OTOH, can't we keep the assert as it is but remove "=3D 1" from > "count(*) =3D 1" in the query. There shouldn't be more than one slot > with same name on the primary. Or, am I missing something? There will be 1 record max and 0 record if the primary_slot_name is invalid. Keeping 'count(*)=3D1' gives the benefit that it will straight away give us true/false indicating if we are good or not wrt primary_slot_name. I feel Assert can be removed and we can simply have: if (!tuplestore_gettupleslot(res->tuplestore, true, false, tupslot)= ) elog(ERROR, "failed to fetch primary_slot_name tuple"); thanks Shveta