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 1sqU48-00A5E5-St for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Sep 2024 09:00: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 1sqU47-007ezI-PR for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Sep 2024 09:00:07 +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 1sqU47-007eyJ-FL for pgsql-hackers@lists.postgresql.org; Tue, 17 Sep 2024 09:00:07 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sqU44-001c4u-Nu for pgsql-hackers@lists.postgresql.org; Tue, 17 Sep 2024 09:00:06 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-535694d67eeso5176762e87.0 for ; Tue, 17 Sep 2024 02:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726563603; x=1727168403; darn=lists.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=6HL9rHR/9w2yg3+quQ+UGkU4GGhMvxNNvpVY0wtJmWs=; b=lF2ZN/q95P/e0t6VoDgUI9n6uTYdoUfJQdI4b/zuN7AkMI+V9Qcz/+yJfq1ANNl93H 4sBOmwv4ysOpU2Y87y+hXVcNVHmFaujXwUMS9vrDPIdE/R9/uxBxFg+DKdJHA9oLMw5d lOUfBLN8vXqohi6tMuDbrWqJhrzUcwt/tTQbHCSb55uS9G8dtWdbyGu66XhqApvVmZJt btOtTf9DsJxvJOkGwa3DR0yAMo6ojVcZmCHDP0Ue4r2W3ggSRkYqt1IGrK7vYqo4lTzx 0tqgDdDAlqwbIVg3IDi3KdlXRnS6bRx1zamZq39SOq45rdUvBx+iugxjVOBH0mFUWaKy EdbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726563603; x=1727168403; 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=6HL9rHR/9w2yg3+quQ+UGkU4GGhMvxNNvpVY0wtJmWs=; b=tGRm+083KeUgHSyyvjApGpuIYVgSjd01zSX40kWKP+D5krItAASoDjpp5vBIh2uItl Thw+lceXWPVY1esijPYNJJDs9OL0HarVfySKOxoIUIVA7F/nuEtoZIuuoJRTzsys8tYG sF2BKxRYNOoxJM+S1c9kTK/1lRHE3Dt5XumNeDGI1oJjhqeGAU2ZJZcHoWmXW6GATqRK WtdXerxIqku3nDmbaFFfqqymY3yyIn0Hj3NVFqAta73x8aN6ufGGSz6oSL1kOEHShu1j TDBhOacNFEuc/SjWrAv1/rG/wYQs7Zzx0Njzymv/cAhUg1hfH16cLCd3mHcr2JdTFrjU aoAw== X-Forwarded-Encrypted: i=1; AJvYcCUJtGdFF9bZIFpFjCqQXWTl/ZKXF+YAll6j8Xvf0ovoJ4cNo+XGGSUewL3AYj4M0uTcxIxXt9med0y+MUm5@lists.postgresql.org X-Gm-Message-State: AOJu0YzUrb9daLt+7yj/jeqjHYiCxsI/8ofzCT6y/EoL4oqet6W5nGoD 0YbzbRlVq+zRuR+fZpI29hlzOGfMCASGvfLCzQMy+YYpMP8GQrJw X-Google-Smtp-Source: AGHT+IEtwIRgJ45uzNf7PeFAEvLlGbziDG55NdthiqckYeIHvK556NI+JyXR4U4y/9iCwZrOzcXzow== X-Received: by 2002:a05:6512:39cc:b0:535:6707:80a3 with SMTP id 2adb3069b0e04-5366bb4861bmr7571323e87.28.1726563602758; Tue, 17 Sep 2024 02:00:02 -0700 (PDT) Received: from [1.0.0.7] ([91.185.76.62]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f79d37f949sm10085901fa.93.2024.09.17.02.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Sep 2024 02:00:02 -0700 (PDT) Message-ID: <88a394be-ebfe-0a3d-f2ac-15f9ce41960d@gmail.com> Date: Tue, 17 Sep 2024 12:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed Content-Language: en-US To: Alexander Korotkov Cc: Kevin Hale Boyes , Kartyshov Ivan , Kyotaro Horiguchi , hlinnaka@iki.fi, alvherre@alvh.no-ip.org, pashkin.elfe@gmail.com, bharath.rupireddyforpostgres@gmail.com, euler@eulerto.com, thomas.munro@gmail.com, peter@eisentraut.org, amit.kapila16@gmail.com, dilipbalaut@gmail.com, smithpb2250@gmail.com, pgsql-hackers@lists.postgresql.org References: <20240620.173045.1163445432733259320.horikyota.ntt@gmail.com> <8d0286f9f0c2f9fc29794dda6b5f4600@postgrespro.ru> <1d7b08f2-64a2-77fb-c666-c9a74c68eeda@gmail.com> <4a7b82d8-17ad-83ae-4aa1-563c3c64c4c3@gmail.com> From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 17.09.2024 10:47, Alexander Korotkov wrote: > Yes, now I did reproduce. I got that the problem could be that insert > LSN is not yet written at primary, thus wait_for_catchup doesn't wait > for it. I've workarounded that using pg_switch_wal(). The revised > patchset is attached. Thank you for the revised patch! The improved test works reliably for me (100 out of 100 runs passed), Best regards, Alexander