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 1sogCg-00CzYo-Kd for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Sep 2024 09:33:31 +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 1sogCg-002nV9-CS for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Sep 2024 09:33:30 +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 1sogCg-002nTh-1S for pgsql-hackers@lists.postgresql.org; Thu, 12 Sep 2024 09:33:30 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0: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 1sogCc-000mRE-Vk for pgsql-hackers@lists.postgresql.org; Thu, 12 Sep 2024 09:33:28 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-718a3b8a2dcso473797b3a.2 for ; Thu, 12 Sep 2024 02:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timescale.com; s=google; t=1726133606; x=1726738406; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EA9YsIw8AcRgPz8V7pbxE3mrA1WQAMh0TcrTcyDFXd8=; b=ZADAWNg2R/ZZWynqJQUHtcANOq0y7RCwYa8NmLmpBAoZx8KF+PqVlx7B5TolV4yWe5 65n8hruQBtWsDLxywbmHz/YTi7QhZxQ0Xt9zVY0LuiWMdmosbZCwtrz6GrEY9nVZsbAO N7C689Fsg1R+6vVyHBL7G/2XK4KRq8xBiMlkixvtAjALekq9wnMfG5T2IIDTu7nydWkS MgEQUoJGqhW7F+suDp71aDVEdQ9ftd/vy7mEwTht31N5EyQSUKFCQmjuoq6gUOJMP6OZ lkzVdgQel2U7yQJ9f6nKN5T3tQjpW3FEq6bSNiZOrwrd+A6I5Y6dHLrBwEjeY4BkUfJb vVLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726133606; x=1726738406; h=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=EA9YsIw8AcRgPz8V7pbxE3mrA1WQAMh0TcrTcyDFXd8=; b=weYG4GmdsGZcGQFcV/xImThu2izF9Cb3YpGBFpPMaBmF7fvkBjrSfhLZhaKeuTMi9m vDEdGGbRFFf9xFyniT2Sm9Td2lz4QoKRNv+zw6pPVsXLkDiiFJnke5hvJ9JPS9lH0bic sf2hvBB1zpS06Onv3/psE7KI227PKwbYYAOMqyMcXenJXzjg3hybgT5ysFLTi58D+jG0 WG+QBrn1x76k7c5WXELJH7Lz/XkItD6FrKBT/7lAot86BSp1wQ/r/iJqG+01hP0tK9Jc OpQYzi5kslO0gb+IBtVwUvZ6czLvfIYEERjTS3gjMnZhIR5K/iJjdPAC3u7B6R9kvP+W KRVA== X-Gm-Message-State: AOJu0Yw8CzqWdICvYbmgvNscK3tOLMqsO/dwRG3XkuHnWKcblnPfv+BJ x1ZwNrQUfTgrYi961//yJo60UpKHKY9VjJqw/2DpeI6VJvvKJ55pT8hdW4iPQEmIw5LlvS9GLLO a8de4Z6OeFHfzyYUc++7M8wZK7fE2c2fUwLNPCsDWkv0Q+hsLoWs= X-Google-Smtp-Source: AGHT+IHONDfT8p1yaaIOjnrOUnaIMKOynTuSynRLzLGCn0Vgqx54aElEUiXQWrVL1rIa5Z/UZtuQAJwYym9G5OCzKgE= X-Received: by 2002:a05:6a20:e84:b0:1d0:7df2:cf39 with SMTP id adf61e73a8af0-1d07df2d4aemr700685637.7.1726133605700; Thu, 12 Sep 2024 02:33:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aleksander Alekseev Date: Thu, 12 Sep 2024 12:33:14 +0300 Message-ID: Subject: Re: [PATCH] Refactor SLRU to always use long file names To: PostgreSQL Hackers Cc: Michael Paquier Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Michael, > On Wed, Sep 11, 2024 at 04:07:06PM +0300, Aleksander Alekseev wrote: > > Commit 4ed8f0913bfd introduced long SLRU file names. The proposed > > patch removes SlruCtl->long_segment_names flag and makes SLRU always > > use long file names. This simplifies both the code and the API. > > Corresponding changes to pg_upgrade are included. > > That's leaner, indeed. > > > One drawback I see is that technically SLRU is an exposed API and > > changing it may affect third-party code. I'm not sure if we should > > seriously worry about this. Firstly, the change is trivial and > > secondly, it's not clear whether such third-party code even exists (we > > broke this API just recently in 4ed8f0913bfd and no one complained). > > Any third-party code using custom SLRUs would need to take care of > handling their upgrade path outside pg_upgrade. Not sure there are > any of them, TBH, but let's see. > > > I didn't include any tests for the new pg_upgrade code. To my > > knowledge we test it manually, with buildfarm members and during > > alpha- and beta-testing periods. Please let me know if you think there > > should be a corresponding TAP test. > > Removing the old API means that it is impossible to test a move from > short to long file names. That's OK by me to rely on the pg_upgrade > paths in the buildfarm code. We have a few of them. Thanks for the feedback. > There is one thing I am wondering, here, though, which is to think > harder about a validity check at the end of 002_pg_upgrade.pl to make > sure that all the SLRU use long file names after running the tests. > That would mean thinking about a mechanism to list all of them from a > backend, rather than hardcode a list of them. Perhaps that's not > worth it, just dropping an idea in the bucket of ideas. I would guess > in the shape of a catalog that's able to represent at SQL level all > the SLRUs that exist in a backend. Hmm... IMO it would be a rather niche facility to maintain in PG core. At least I'm not aware of cases when a DBA wanted to list initialized SLRUs. Would it be convenient for core / extensions developers? Creating a breakpoint on SimpleLruInit() or adding a temporary elog() sounds simpler to me. It wouldn't hurt re-checking the segment file names in the TAP test but this would mean hardcoding catalog names which as I understand you want to avoid. With high probability PG wouldn't start if the corresponding piece of pg_upgrade is wrong (I checked more than once :). So I'm not entirely sure if it's worth the effort, but let's see what others think. -- Best regards, Aleksander Alekseev