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 1jMf3e-0001rj-6I for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2020 21:49:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMf3b-0006bY-Mp for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2020 21:49:55 +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 1jMf3b-0006ZW-AQ for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2020 21:49:55 +0000 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jMf3Y-0000bh-An for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2020 21:49:54 +0000 Received: by mail-qv1-xf41.google.com with SMTP id w26so101908qvd.10 for ; Thu, 09 Apr 2020 14:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=T56QtFDuqgTMETUjdh+PQlVHwBy16d2iJVyQQfK6mYI=; b=C4aywFPqPQG1Ixftiay5QsovkO1E3uu/dPLBFHqt7VGHg0CyWYJMHasF975BAwA2SW ixKBDkiyUoCecGpPyxrgpAy8Y2R1lG7qzT+yhCLcCudzHuMSqbAYXwxbqQHhs6SDzJi+ JN+kP+S+cIPQtleHVMk/0PER8VToHLUTIhXld49IoQTkcxFkfJlU46AeHjI6YlUJIXZu fNiquvjsGHG6sAco7rWvSvwJk+o9YyHj2P4pp5u3ly4x/0SQJ0qt2JETv9XLVBSw8kAA 9YuzFlH5YNDUsDAPy7nKYGgBwdFLYcf8ZNg/IsG/3f8iN6LWGUOmk5aqFdF9PPdfDo6b bNZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=T56QtFDuqgTMETUjdh+PQlVHwBy16d2iJVyQQfK6mYI=; b=mGlxN/CPRA6x06sz3k1anNp5ZQdvtndZ4B1Nq8Z1kMs/5pjuFxxT5meSMJ76CN1Xg4 PV0bIQwx685GwhPzG/1Xq0nWc2/FVpVNoO7X5Qq30lzXPGP7l63KraOjyJQJKwOropP6 N0wMabU0IrpHDJdshouWPwnXNzq0kKQ7MCJOV2iM4HUOWchED2opz/Sn4EDJtubj73mO 2liIyEVu4yqHYXo2UKyCiBUsGu2VzEeDpB+kgm4zAmRmvRgX+5SqmgG4Uom22qWkhMNC bLYkBHh31z2Q0xnsTG4CVW3TRJh5ZaXZOzUnEeA2goVdKvYBGq6dqnLwVqelwYVcnZOt Bo2A== X-Gm-Message-State: AGi0PuZwvUhD09xCs6jrtzqN1ZOJHvcIivKBSB/GZu97lVVbK/IfwXLD F9W2n2fUSOxGGeBbNQtts31t3wa24VIu3C+3mrQmsdo3gA8Yuns5L+SStmZvYXen/iuGec9CY/Q CtmEOgA2zfy8AYlnhiZ4ijEP6MtIuHUXlfCZzkcMiNBIourRZL+CRy6DXwkcF1XL7jT3xygpOqI BHBR+R1JEAq7f+a5G8 X-Google-Smtp-Source: APiQypJ3nEwEWaCLK+VFWmuYAF39Mi+rjVIMHERbAjqYfdRwdU29bYX1c/R0Va7miWvLD5vZOQGPfA== X-Received: by 2002:ad4:4766:: with SMTP id d6mr2162065qvx.136.1586468990389; Thu, 09 Apr 2020 14:49:50 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id d4sm115845qtc.48.2020.04.09.14.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 14:49:49 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 89B53300A5A; Thu, 9 Apr 2020 17:49:47 -0400 (-04) Date: Thu, 9 Apr 2020 17:49:47 -0400 From: Alvaro Herrera To: Thomas Munro Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Rationalize GetWalRcv{Write,Flush}RecPtr(). Message-ID: <20200409214947.GA22655@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Apr-08, Thomas Munro wrote: > Rationalize GetWalRcv{Write,Flush}RecPtr(). > > GetWalRcvWriteRecPtr() previously reported the latest *flushed* > location. Adopt the conventional terminology used elsewhere in the tree > by renaming it to GetWalRcvFlushRecPtr(), and likewise for some related > variables that used the term "received". > > Add a new definition of GetWalRcvWriteRecPtr(), which returns the latest > *written* value. This will allow later patches to use the value for > non-data-integrity purposes, without having to wait for the flush > pointer to advance. It seems worth pointing out that the new GetWalRcvWriteRecPtr function has a different signature from the original one -- so any third-party code using the original function will now get a compile failure that should alert them that they need to change their code to call GetWalRcvFlushRecPtr instead. Maybe we should add a line or two in the comments GetWalRcvWriteRecPtr to make this explicit. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services