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 1oMHJ1-00072w-Bx for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Aug 2022 23:09:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oMHIz-0000j0-1B for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Aug 2022 23:09:33 +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 1oMHIy-0000he-Gb for pgsql-hackers@lists.postgresql.org; Thu, 11 Aug 2022 23:09:32 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oMHIu-0000wB-7B for pgsql-hackers@postgresql.org; Thu, 11 Aug 2022 23:09:32 +0000 Received: by mail-pf1-x434.google.com with SMTP id f30so17341159pfq.4 for ; Thu, 11 Aug 2022 16:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=OJ6KA/E/JMFDZB2/Hx7kK7s502XwSihJjo/vovHI2q0=; b=iYB+wozCXsKryyYt5orq7If3/EMxqyxgE2U1QNNTAdT35ejINEHrcPMRZpu1TK5cqR e9+Y7s1iRo2ChCXBsfhATwJHo6LGB1EgktFcq9KuXHiD3mJAS8zQRQZxgcabOs+T0xi7 mFb6iIBKJ2uA3YWjAlf/qx1B35SIw2ILs1GmKfRKHfYoCRBswx2BTAX/X829jKNWR8md WunI3lCfSMdhHf7YVbCpAHRzQiqp6nvga9DB03ffWvvdwvsb1Qu8tw3tuJqrvCz+QrNW Ytd1/VRorcampWiTq1WJDSgG8sMGTyXaxh3NO4b+oLyFs4+1fQA39PIBA+JR210fzZBE EF8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=OJ6KA/E/JMFDZB2/Hx7kK7s502XwSihJjo/vovHI2q0=; b=jZVe2kbX2r1JxEDyt7RSWQwXbsWl8yfNxNtyxkj9Yjr7YIW3lQEbYzv7rqTRrXiu+y WwnM+29Es8s+F0pjOCB9CT90ftKK9iv2p2Th+wHn6CBELyhEZnDYoEJMoxKNi4XU00jl hNfUH3b/QyPeRz3Nlj46Xp4EYc5QDd++FbglhcNYaD5Cw0xp++fJxCwA91xZeyqGdG92 7mAvPH8vH5pZtVZ8GBjrte0DWhTLMpaAN+6XIzpZM4YBIcaKIjWEJbSa5AyYjBvM+qAy GAXBz5jV6U2Rq2Gdm8NMZ9FE9HCKtWZTcAHnUbM6HMDsxZKA8JJ2x6vaumfR97/Vpda8 CMNw== X-Gm-Message-State: ACgBeo3KUO7MwtOfWDN/P2WeM2FssoFZevR0ndZcOVglToWBjzP8ONzo uvmkK6Bh/A5MolblL+oYH/Y= X-Google-Smtp-Source: AA6agR6lNKAlVsELTbFJgIymnKu2XhQvHRnwXqNKDmzTlsNjP9ZsrpFKiosiBL0Y3OqpvViObgb52A== X-Received: by 2002:aa7:8d04:0:b0:52e:1778:bcde with SMTP id j4-20020aa78d04000000b0052e1778bcdemr1362216pfe.58.1660259365142; Thu, 11 Aug 2022 16:09:25 -0700 (PDT) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id d19-20020a170903209300b0016edb59f670sm224153plc.6.2022.08.11.16.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Aug 2022 16:09:23 -0700 (PDT) Date: Thu, 11 Aug 2022 16:09:21 -0700 From: Nathan Bossart To: Andres Freund Cc: Simon Riggs , Robert Haas , "Bossart, Nathan" , Bharath Rupireddy , Maxim Orlov , Amul Sul , Bruce Momjian , "pgsql-hackers@postgresql.org" Subject: Re: O(n) tasks cause lengthy startups and checkpoints Message-ID: <20220811230921.GA1707962@nathanxps13> References: <20220218205111.GA3447220@nathanxps13> <20220623171552.GA96638@nathanxps13> <20220702220554.GA1044460@nathanxps13> <20220702225456.zit5kjdtdfqmjujt@alap3.anarazel.de> <20220703170754.GA1048244@nathanxps13> <20220703172732.wembjsb55xl63vuw@awork3.anarazel.de> <20220706165110.GB2135371@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <20220706165110.GB2135371@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 06, 2022 at 09:51:10AM -0700, Nathan Bossart wrote: > Here's a new revision where I've attempted to address all the feedback I've > received thus far. Notably, the custodian now uses a queue for registering > tasks and determining which tasks to execute. Other changes include > splitting the temporary file functions apart to avoid consecutive boolean > flags, using a timestamp instead of an integer for the staging name for > temporary directories, moving temporary directories to a dedicated > directory so that the custodian doesn't need to scan relation files, > ERROR-ing when something goes wrong when cleaning up temporary files, > executing requested tasks immediately in single-user mode, and more. Here is a rebased patch set for cfbot. There are no other differences between v7 and v8. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com --X1bOJ3K7DJ5YkBrT Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v8-0001-Introduce-custodian.patch"