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 1nkptG-0003Jz-27 for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Apr 2022 16:24:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nkptE-0004CK-RI for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Apr 2022 16:24:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nkptE-0004CB-Ew for pgsql-hackers@lists.postgresql.org; Sat, 30 Apr 2022 16:24:12 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nkpt9-00022v-Hp for pgsql-hackers@lists.postgresql.org; Sat, 30 Apr 2022 16:24:12 +0000 Received: by mail-pf1-x433.google.com with SMTP id p12so9321466pfn.0 for ; Sat, 30 Apr 2022 09:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cdt1rGv5Kzf2ezPywBpxjbRSFEv1etM3rNJZmPF0PrU=; b=IONPJvldySERzU6RLcg8joKw0apNdxBAjwWWVC4ZS6Z0XU8uD/9pFLkPLE+9EgT4f+ GXWIpYMKz9a/A82viHkMe+bvWhpNXqTgUdQN6ltCIfcfDzM0EiZWhWmA9Ni3gxrUqsxN T55Ikj0kcv9gJ1kvVkX16mU3YGELQf29jcfjyUG6LIznKOCCgOa7+yEV1pou4PpSNyEL W86YD/Bw3EDYcOP0KXxtaob6UtvNbA+6tAlRTHK/BIG0j9VbIsXDjKo0t3SWMaJPA4UZ 9jxU129T6YJpWOlmNpqaULEqlEZO/yt4Rujqp4DzcQTZBGaBdKU4lVLi78o1zjgkgh2y xPfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cdt1rGv5Kzf2ezPywBpxjbRSFEv1etM3rNJZmPF0PrU=; b=cjoC0XTuuImijLijYClQwNUK+7inPRAXkvUUCx/emScno8d1EeXDv7fhZ4A39hr8eZ uuGMnIPD3fJ3j5g4qAMGn9paGEDCffQMArtcpUyqm9U8Kh1yCUx+gRr3ogNtnwx37Ib8 fcDPxwCGmYmu0h0PVsZkNuGIzpoYKs1xlOjShEc4UXYmKShTm3+bfg2qP8p3uQX4AcLw 1oKLCtpx74pNkbypZ7xNHFOKib/4+t0T8b3weNqWRTgOWbGb47o+u/8XYziEYtXd8IcD 9W9D6RCMRYJX9t53KUM8BOnhQLnV9G2pEPXfuhuYfnEImISlMASDLCprhvjt/HRBcRS6 HOfw== X-Gm-Message-State: AOAM531Xky28UOtEmWrHF6SI8G2WDOdz7OAzEh4tYmhfiq+5zXmjwUpi KIhRf9G5/nCZ68zH+08fVQAZmQ== X-Google-Smtp-Source: ABdhPJwk/ISjrnn7Tp5NKKvNBThNv/FHeMMFBBaV+pbHGYpTZciffdA+JEEYQXyQlX9TgsAp5+gQHA== X-Received: by 2002:a65:424d:0:b0:3b4:26f1:c3e0 with SMTP id d13-20020a65424d000000b003b426f1c3e0mr3583799pgq.443.1651335844414; Sat, 30 Apr 2022 09:24:04 -0700 (PDT) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id d10-20020a17090a628a00b001dc09ba3d6asm4670985pjj.15.2022.04.30.09.24.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Apr 2022 09:24:03 -0700 (PDT) Message-ID: Subject: Re: pgsql: Add contrib/pg_walinspect. From: Jeff Davis To: Bharath Rupireddy Cc: Thomas Munro , Tom Lane , Michael Paquier , Noah Misch , Jeff Davis , Postgres hackers Date: Sat, 30 Apr 2022 09:24:02 -0700 In-Reply-To: References: <171769.1650950714@sss.pgh.pa.us> <287795.1651019129@sss.pgh.pa.us> <295868.1651024073@sss.pgh.pa.us> <298689.1651025716@sss.pgh.pa.us> <304865.1651029340@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2022-04-29 at 10:46 +0530, Bharath Rupireddy wrote: > It's not just the flush ptr, without no wait mode, the functions > would > wait if start/input lsn is, say current flush lsn - 1 or 2 or more > (before the previous record) bytes. If the functions were to wait, by > how much time should they wait? a timeout? forever? I see, you're talking about the case of XLogFindNextRecord(), not XLogReadRecord(). XLogFindNextRecord() is the only way to align the user-provided start LSN on a valid record, but that calls XLogReadRecord(), which may wait indefinitely. If there were a different entry point that just did the alignment and skipped past continuation records, we could prevent it from trying to read the next record if we are already at the flush pointer. But without some tweak to that API, nowait is still needed. Committed your v3 patch with minor modifications. Regards, Jeff Davis