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 1v3vbG-005j1B-Tu for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Oct 2025 12:06: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 1v3vbE-001W8C-Ul for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Oct 2025 12:06:25 +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 1v3vbE-001W7V-KJ for pgsql-hackers@lists.postgresql.org; Wed, 01 Oct 2025 12:06:25 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v3vbB-000rma-2z for pgsql-hackers@lists.postgresql.org; Wed, 01 Oct 2025 12:06:23 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-371e4858f74so10935691fa.1 for ; Wed, 01 Oct 2025 05:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1759320381; x=1759925181; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eIWfZTiNE9JeqOIlPC3RpYLBfZQYS4eYEeOKNKTZSZw=; b=V4T/w8f8Y9n70BIL2KYcmyffSwluIaUJ/m9eTmv6pwSbIQ2/VZXp5ADhBY8jPUXEkl 6zbQUtjQ04b+Aoto/SlOAu108GUIZc6IC3LIwz53PgTZ/iH4aZqqNuV5sFiDo5QrgfIW Uopel8yuCmikjHZo33K8pAce8o4RSr06ZbWRzCO3SHzhfpsq+5Fi9LFnK9yvf5oTp/Io TUJ3ypLW3SPu8RxVFIw6vK9RcR4fYC0dD5uG58i6rQ62aOpZ1aGHXibCBGkMiOGUvSFD 8GM6rCOakzQNxZcio0Qkm0q3NT/b289dhQ0G5UI/fjN/B4C+yQi8NZOP7EeAJGufrPLH vMAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759320381; x=1759925181; h=content-transfer-encoding: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=eIWfZTiNE9JeqOIlPC3RpYLBfZQYS4eYEeOKNKTZSZw=; b=MNElQpPQuoNbqbfoqaRPAByl48hCIQPfiC1D1o1Z5OGEkydcTSiRr3Xiz8JXBRHU4l uvv4COaxSsd/mK7vGEBR6ie2GhW6ISknbLGjclb99JRnn1ddVT7s6FqrMgCd5HQBLV2G 3MjaLxz3h4YpOCdiTYSSmmeH77gvNeCwaoH/8rSZdxjPsLcJ3Uz/19Yl9zIAmbU02bk1 lOPq160mWjmipwKEbIJSeBRBcWgxHd9SyNxhvn7k9cbND+sIyohUqg+ibzyDHE1z5/MH X8NFg7JVrRZlgrJnyCArx7/tnQVFwX2mGbcmWUX5l19lgAT5/MNlf8jPSPmGRQHUe3fL OETg== X-Gm-Message-State: AOJu0YwOIVNaKHdssVjv+ysgKNk2yC7VanK3wkOJBukyzJbvlP645CTW Agv6SSnLxoQrqjL70jCqhUoyxdTBJK76eiHw2xSENrPqv+jfR5yTNQR3spJPAG8h/NsNbZXyz7E uZZxFw6gf1969oz6koGQFT5SpUcDq7GOoCq9FWxV4 X-Gm-Gg: ASbGnct3XsQ1vCKahdwMym2CABfOFW3op9+aO83Ux3qgR+lOgD4zq44M2TsfW/4VHec 5/ciiezRTmhWXiPNdYpi+77wfOtCDU+sCtPZ70gQ/8MT1QxIxzp1kitJzRk8eUN+nf+nX2Eflr5 X6sRyp/mLVkm0NedfZhi/6ADcx8FTZtOXAYmIHKn7iF1DUhVq9kGZc/RTC9Rf5p161g+CXztDWm i5ljRKHRzi93zoDPpXvPWTaxk0UeSzu X-Google-Smtp-Source: AGHT+IGhH5iZf9tDXvdyO+gPGlI+nQ3URNRruXcJJwEc8Wi/3YiUhxnJbMOrle6BuEJa2T/L9udtQkwJynMTt3nX+V8= X-Received: by 2002:a05:651c:502:b0:372:89df:9673 with SMTP id 38308e7fff4ca-372fa29f95fmr22044391fa.13.1759320380774; Wed, 01 Oct 2025 05:06:20 -0700 (PDT) MIME-Version: 1.0 References: <013D63E2-5D75-492E-85FF-1D5CC0148C82@gmail.com> <499686.1759250489@sss.pgh.pa.us> <68dcd1f2.df0a0220.3300c0.f7af@mx.google.com> In-Reply-To: From: Jakub Wartak Date: Wed, 1 Oct 2025 14:05:53 +0200 X-Gm-Features: AS18NWAMAk49FMBxRSNUWgIJb4TWBZBcHzGfkpLZTGU2mAyXgsrPv1YGXq7cXgM Message-ID: Subject: Re: The ability of postgres to determine loss of files of the main fork To: Aleksander Alekseev Cc: pgsql-hackers@lists.postgresql.org, Michael Banck , Tom Lane , Frits Hoogland Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Oct 1, 2025 at 1:46=E2=80=AFPM Aleksander Alekseev wrote: > > Hi Jakub, > > > IMHO all files should be opened at least on startup to check integrity, > > That might be a lot of files to open. I was afraid of that, but let's say modern high-end is 200TB big DB, that's like 200*1024 1GB files, but I'm getting such time(1) timings for 204k files on ext4: $ time ./createfiles # real 0m2.157s, it's open(O_CREAT)+close() $ time ls -l many_files_dir/ > /dev/null # real 0m0.734s $ time ./openfiles # real 0m0.297s , for already existing ones (hot) $ time ./openfiles # real 0m1.456s , for already existing ones (cold, echo 3 > drop_caches sysctl) Not bad in my book as a one time activity. It could pose a problem potentially with some high latency open() calls, maybe NFS or something remote I guess. > Even if you can open a file it doesn't mean it's not empty Correct, I haven't investigated that rabbithole... > or is not corrupted. I think checksums guard users well in this case as they would get notified that stuff is wonky (much better than wrong result/silent data loss) -J.