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 1oJGp0-0001Sw-Qw for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Aug 2022 16:02:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oJGoz-0004rm-OQ for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Aug 2022 16:02:09 +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 1oJGoz-0004rd-FF for pgsql-hackers@lists.postgresql.org; Wed, 03 Aug 2022 16:02:09 +0000 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oJGou-0006RP-Ni for pgsql-hackers@lists.postgresql.org; Wed, 03 Aug 2022 16:02:09 +0000 Received: by mail-qt1-x833.google.com with SMTP id e23so1052206qts.1 for ; Wed, 03 Aug 2022 09:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc; bh=qONNuTTyra8JT6akfvwLLAZXzV3r8COvepk1A/XaW6I=; b=KwMz2Y7kMETJFFWSp8fPwQApMrDj+Uz4cklWGd/C5MTJi8CS06m5gN2LA4vYp6qG5v g/0WEhwe1szCN+bOcuvLYFkR1WRyLqeEKuL+3upEk5pyCRtjJLm4e6e5YBdYKnRAbqCX ykNoCcXbS6uk/9ztZ/juQ1eNgajrc30Ce2JN4enuJtqkZJBwQzIEczRcTZx2MHq6iIzH wZfqvoNRyN4x7n3BCCMhwHHLCMaiEntVyxKtnBTSH2G4kO7hrsMS0ClwBu3VwO37dxkO 1tBnWi1jbUq/3/3GZA5Iw15F+UvdJKDdrmWI4chpuMjoyvpZD3cCSjdK9xLRXYLE0jp0 Y9AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc; bh=qONNuTTyra8JT6akfvwLLAZXzV3r8COvepk1A/XaW6I=; b=XRPCpUOga6cq/e9HcXl2F6tFr+IiUlr1BD2KYaoZAexiRAyaCo2yqx1wCxW3cQGjkE KePaH+ZcE1ooK3JDEHolLGCor5ytlMGtLjWaLFtv7S9oxlXg6Iljn7+jRJNw7zbRSzgS yrmX7XPF1jcjOXFdaWcRoYvx9wh1MsqP3bUExvOhPU7rQ/EhF116IkgnMNpG5h4U7yR+ PCU3nBt7KHWfXHDdwETirjKCOtAwVFL0rVu3YdMyG2JKIWiih6FjA6f+wrlMCXFU1tDc XYjSYZ+yfxS4U3bo0lIgVS/PqiJfqYx6iyzSD1RZeixA2Y2Q+Ufh0tsQNuU1hMALeiTw /miA== X-Gm-Message-State: AJIora/EzWhTzg2d1tVQjsIp8SfRKUod3lOZMgHH4NxoetJuVAqtF04f cMVSVEohisFOgTZLg3M/NkcP8w== X-Google-Smtp-Source: AGRyM1tEIcrO80QY5I7J60XD7lSWU12LKyEkRkXn9Wn4pn11B6shOvQw4g6iiCUO0iQTnF4v4WEleA== X-Received: by 2002:a05:622a:109:b0:31f:3302:3367 with SMTP id u9-20020a05622a010900b0031f33023367mr22860809qtw.488.1659542521816; Wed, 03 Aug 2022 09:02:01 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id ez15-20020a05622a4c8f00b0031bf5677d96sm11103709qtb.84.2022.08.03.09.02.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2022 09:02:01 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id D139B80091B; Wed, 3 Aug 2022 11:02:00 -0500 (CDT) Date: Wed, 3 Aug 2022 11:02:00 -0500 From: Justin Pryzby To: Dilip Kumar Cc: Andres Freund , Tom Lane , Robert Haas , Ashutosh Sharma , Maciek Sakrejda , Bruce Momjian , Alvaro Herrera , Andrew Dunstan , Heikki Linnakangas , pgsql-hackers@lists.postgresql.org Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints Message-ID: <20220803160200.GD19644@telsasoft.com> References: <20220802175043.GA13682@telsasoft.com> <2767668.1659476794@sss.pgh.pa.us> <20220802220416.GC13682@telsasoft.com> <20220802222334.umf5wsa2r63koppn@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Aug 03, 2022 at 04:45:23PM +0530, Dilip Kumar wrote: > Another version of the patch which closes the smgr at the end using > smgrcloserellocator() and I have also added a commit message. Thanks for providing a patch. This seems to fix the second problem with accessing freed memory. But I reproduced the first problem with a handful of tries interrupting the while loop: 2022-08-03 10:39:50.129 CDT client backend[5530] [unknown] PANIC: could no= t open critical system index 2662 In the failure, when trying to connect to the new "a" DB, it does this: [pid 10700] openat(AT_FDCWD, "base/17003/pg_filenode.map", O_RDONLY) =3D 11 [pid 10700] read(11, "\27'Y\0\21\0\0\0\353\4\0\0\353\4\0\0\341\4\0\0\341\4\= 0\0\347\4\0\0\347\4\0\0\337\4\0\0\337\4\0\0\24\v\0\0\24\v\0\0\25\v\0\0\25\v= \0\0K\20\0\0K\20\0\0L\20\0\0L\20\0\0\202\n\0\0\202\n\0\0\203\n\0\0\203\n\0\= 0\217\n\0\0\217\n\0\0\220\n\0\0\220\n\0\0b\n\0\0b\n\0\0c\n\0\0c\n\0\0f\n\0\= 0f\n\0\0g\n\0\0g\n\0\0\177\r\0\0\177\r\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\= 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\= 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\= 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\= 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\= 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\362\366\252\337", 524) =3D 524 [pid 10700] close(11) =3D 0 [pid 10700] openat(AT_FDCWD, "base/17003/pg_internal.init", O_RDONLY) =3D -= 1 ENOENT (No such file or directory) [pid 10700] openat(AT_FDCWD, "base/17003/1259", O_RDWR) =3D 11 [pid 10700] lseek(11, 0, SEEK_END) =3D 106496 [pid 10700] lseek(11, 0, SEEK_END) =3D 106496 And then reads nothing but zero bytes from FD 11 (rel 1259/pg_class) So far, I haven't succeeded in eliciting anything useful from valgrind. --=20 Justin