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 1qwOn5-00BRoz-NA for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Oct 2023 15:30:27 +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 1qwOn4-00GmQa-BC for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Oct 2023 15:30:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwOn4-00GmP4-1N for pgsql-hackers@lists.postgresql.org; Fri, 27 Oct 2023 15:30:26 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qwOn1-002any-0u for pgsql-hackers@postgresql.org; Fri, 27 Oct 2023 15:30:24 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-32da4ffd7e5so1328501f8f.0 for ; Fri, 27 Oct 2023 08:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698420621; x=1699025421; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=galt607AviKpN9Pe90IlMzYzh1t45drY7KNiZ7VtAjI=; b=fGpzM0s00CZIagLotglUL4wI0STGRqAJIYV1rdwrE4Q9+K+rkHSyoQirDXx3ZhGWhg y+Ij4GtiLT+deSxoTBCxqQ0wTLxdsBiUTM9t7I1sfOUU2IzrJofr27kojepDju7ND2no mPygIw/+RtGboymW3eJzNmqFmYPkHqIxgajhmMjJK2lRj5DFXWAb99JhiRV90rdgrJqJ Uj/mVSXJ9EM4CWwdF17HfbCr4S12+TrSRGJ9DKiY5nWDrUkpl/0raDacqMIYJi1+/+8Z BtTVSxkqf6kbgNpzvh16SksVGxTeoSVpiUM65B8gOAoFu8Xq5Py3nimywjsS0u122+C+ k23w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698420621; x=1699025421; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=galt607AviKpN9Pe90IlMzYzh1t45drY7KNiZ7VtAjI=; b=Fa2AEa4QstqG4Djss9DiLmLIMDeJ5NkhF2L7//B2PsPQy09NnbSVQ49Z3rWVGKLiz6 TkgMcYPt+90XWqGCGed3ke51lAbUq8CgeapJX9RpUZ7twaXX4sxgOsvV7rM0rYwumgm8 A47svCJgESEhbkf2G3jcGcPOuiUCk5iWKNTGTD87iFeF4a/VAw5wgN7nPaFNGWGqHIaF ensm7hG2sqzSI5bgWluXZbSUZRdWU8JLiiweBrYQaV0eHx/ZfP7C2uB1vuslhwplshSG aXI7TXHXjrZlavqBDX3e7xL/d39u5YnLq0v1FREfPZWps5skWJRriW0LL+P08754sYiX 3icA== X-Gm-Message-State: AOJu0YzSeh3m/xTSXOxogblHURtGf1cK4+4oEFsIPEveEOnfskKgbqMC MRpU6Oj4COQCo9BdIxoRCO0= X-Google-Smtp-Source: AGHT+IE5ffBiY5OEG4EKOkZhk4DUZpynxBrMRKUVI+XE83dE5su5LbFQllNTLBr+zLOw/bl+v9gdfw== X-Received: by 2002:a05:6000:2c6:b0:32d:c755:d73d with SMTP id o6-20020a05600002c600b0032dc755d73dmr7720981wry.18.1698420621273; Fri, 27 Oct 2023 08:30:21 -0700 (PDT) Received: from ?IPV6:2a01:cb11:192:7000:1d07:7031:da21:e76c? ([2a01:cb11:192:7000:1d07:7031:da21:e76c]) by smtp.gmail.com with ESMTPSA id h13-20020a5d548d000000b0031c6e1ea4c7sm1952711wrv.90.2023.10.27.08.30.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Oct 2023 08:30:20 -0700 (PDT) Message-ID: <681e1874-0a79-4a01-8536-f358f37fd3f0@gmail.com> Date: Fri, 27 Oct 2023 17:30:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Synchronizing slots from primary to standby Content-Language: en-US To: Amit Kapila Cc: shveta malik , Peter Smith , "Hayato Kuroda (Fujitsu)" , Bharath Rupireddy , Peter Eisentraut , Bruce Momjian , Ashutosh Sharma , Andres Freund , pgsql-hackers , Ajin Cherian , Alvaro Herrera References: <2533785b-9e06-4567-943a-79c862ed8fcc@gmail.com> <83e42acb-8673-46eb-bc2f-e69427947a9d@gmail.com> <0bc504f3-8631-4a95-b711-6233d4738a09@gmail.com> <7bb1ec08-d6e3-49fb-8b80-56ca88445e0d@gmail.com> From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 10/27/23 10:35 AM, Amit Kapila wrote: > On Wed, Oct 25, 2023 at 3:15 PM Drouvot, Bertrand > > I think even if we provide such an API, we need to have logic to get > the slots from the primary and create them. Yeah, my idea was to add an API (in addition to what is already in place). > Say, even if the user used > the APIs, there may still be some new slots that the sync worker needs > to create. Right. > I think it might be better to provide a view for users to > view the current state of sync. For example, in the above case, we can > say "waiting for the primary to advance remote LSN" or something like > that. We are already displaying the wait event "ReplSlotsyncPrimaryCatchup" in pg_stat_activity so that might already be enough? My main idea was to be able to manually create/sync logical_slot2 in the test case described in [1] without waiting for activity on logical_slot1. But another (better?) option might be to change our current algorithm during slot creation on the standby? (to avoid an "active" slot having to wait on a "inactive" one, like described in [1]). [1]: https://www.postgresql.org/message-id/afe4ab6c-dde3-48ea-acd8-6f6052c7b8fd%40gmail.com Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com