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 1tCjrd-00C1bM-IS for pgsql-admin@arkaria.postgresql.org; Sun, 17 Nov 2024 18:19:12 +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 1tCjra-0015Nk-Vo for pgsql-admin@arkaria.postgresql.org; Sun, 17 Nov 2024 18:19:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCjra-0015NY-In for pgsql-admin@lists.postgresql.org; Sun, 17 Nov 2024 18:19:11 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tCjrX-002Rzc-Dg for pgsql-admin@postgresql.org; Sun, 17 Nov 2024 18:19:10 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-382411ea5eeso323618f8f.0 for ; Sun, 17 Nov 2024 10:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=cybertec.at; t=1731867545; x=1732472345; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=tCc6JzXd453E7TM570HaBMKNtqCV5xF/hZdpejEiUUU=; b=Ih7wdsPl/U/BZc+8mbDIBDDP4xZqtY6VlaHYaYzksukYCeT8vE/pdMJChz9RubVY94 JEU3B35DIpVj6GIHrFhmC/iZC5dF60FeEHs0oA1zYA9vyV0TOUIMrxzwOwcV5iH8CedW HmZhNlnwjzF+nT4+HAeiPGMpdIIJGJfuxG9VQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731867545; x=1732472345; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=tCc6JzXd453E7TM570HaBMKNtqCV5xF/hZdpejEiUUU=; b=HiAyzfrdU9tsU8cYlzjTsdUP5CNat19Nx45VTqmAefgFObn28nIGkd2KwDthd479tD RFgo2dCz1L6W7+cD6m26T0OExRIzpcT90FpwHqC6HzQV8gg739qmSjAg976TqGTL69ph pGHsce9ZGoWU3X/j8gXPnubEh4kvs2QN5rnFDdeKCQcCJc369NF0OT+rFChNoyLoZC+r F+i3l+rza2dFLFPSk1jXVZxs9u3cy5mHXsVZhXTz7NE7s3LfrkTd49/2GP6p3IraCGPV x73VPplUW3y8c7jzv3WaauwXnOAsogwnanqm4uqBprf4pwYJILSRx8QowfixbtGNPG/H HFBA== X-Gm-Message-State: AOJu0YxLNHqU8+qK/VK2/w9YxSpb1eHEo305vx+2+ciAAmOCtDq21ESc jqnFwsqbllLzRbhESg5zoYL33izwMw/Av9k+knuqmvxkIhWOiCbNNXJU+w3WJkU= X-Google-Smtp-Source: AGHT+IEu3kh3fqSgQO3FZBrpyftuA2750mFueQmTahAdVOkKFmRYA5KnjDSEX4wbVdSJLO9jwZhHnw== X-Received: by 2002:a05:6000:2ab:b0:37c:fbb7:5082 with SMTP id ffacd0b85a97d-38224fd041amr7434416f8f.25.1731867544335; Sun, 17 Nov 2024 10:19:04 -0800 (PST) Received: from localhost.localdomain (ip-185-104-138-25.ptr.icomera.net. [185.104.138.25]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae321c5sm10323025f8f.106.2024.11.17.10.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2024 10:19:04 -0800 (PST) Message-ID: <44c1b3003bced2e9eac55184666d22502e97de4d.camel@cybertec.at> Subject: Re: RDS restore failed due to WAL log and disk space-- any tidy fixes? From: Laurenz Albe To: Wells Oliver Cc: pgsql-admin Date: Sun, 17 Nov 2024 19:18:58 +0100 In-Reply-To: References: <14770c231bf27ea6d22376395ac8f02e41462ed5.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-2.fc40) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 2024-11-17 at 09:12 -0800, Wells Oliver wrote: > On Sun, Nov 17, 2024 at 7:41=E2=80=AFAM Laurenz Albe wrote: > > On Sat, 2024-11-16 at 16:33 -0800, Wells Oliver wrote: > > > I provisioned an RDS instance with 2500GB space and began the restore= of a database I know to be about 1750 GB using 16 jobs. > > >=20 > > > Unfortunately, it died very near the end when it ran out of disk spac= e due to WAL log usage. Lots of: > > >=20 > > > 2024-11-17 00:07:09 UTC::@:[19861]:PANIC:=C2=A0 could not write to fi= le "pg_wal/xlogtemp.19861": No space left on device > > >=20 > > >=20 > > > And then kaboom. > > >=20 > > > I'm wondering what my course of action should be. Can I disable/reduc= e WAL during a restore? > > > wal_level is set to replica, can this temporarily be set to minimal? = Should I just eat the extra > > > costs to add headroom for the WAL? Would using fewer jobs during a re= store reduce the amount of WAL > > > created? > >=20 > > If you are using minimal WAL logging and you restore the dump in a sing= le transaction, you > > should see way less WAL generated, because data inserted into the table= in the same transaction > > as the CREATE TABLE statement need not be WAL logged. > >=20 > > But you might more easily solve the problem by speeding up or disabling= the WAL archiver, > > so that PostgreSQL removes old WAL after the next checkpoint. > > Interesting. I am migrating a pg_dump archive to a new server, in a singl= e go. Does it make sense > to disable (or speed up?) WAL archiving during the restore, then reenable= it after the restore so > a future replica could work? What would be the steps here? Would disablin= g or "speeding up" be faster? Ah, I ignored that you were using a hosted database. Then you probably can= not configure WAL archiving. Yours, Laurenz Albe