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 1jdJp6-00018f-Sg for pgsql-bugs@arkaria.postgresql.org; Mon, 25 May 2020 20:35:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jdJp5-0005b3-Mx for pgsql-bugs@arkaria.postgresql.org; Mon, 25 May 2020 20:35:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdJp5-0005av-Ha for pgsql-bugs@lists.postgresql.org; Mon, 25 May 2020 20:35:47 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jdJp3-0003N8-4t for pgsql-bugs@postgresql.org; Mon, 25 May 2020 20:35:46 +0000 Received: by mail-qk1-x741.google.com with SMTP id n11so13046284qkn.8 for ; Mon, 25 May 2020 13:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=sRG0/KbibqYEE7gt4W9PdCeTiMNsbz3plnAnFI0Z+Uo=; b=1kmCMVOrz5i3rAaCmd51BoU1jvQQZqizEAygm7/v/CpbWzDYTyruPV12IhvJ4TnXQK qEW6O48fZY1bJ/uSWmglWDnTx3/vXz/q1FjPmPji1ERASXhPUvZulyF1ogkroV04/wOM 6Is/p1arDl3n2a82nU1r+5JAZf027iEOU4xQV+pvyOs0KvHqKE7GjWMgjIYizwyZKQLB +J5Ur0SYlAUpX/H/YFPWcKxMLNc5J7LL0D/tDuRfZI+YWcovezBaj07rV/HyWU8/PUtn b25Gvatx7k2GLNlP7HPyosaXjAenxDwD/gZcFmYDzvyWQz6VgeDen1reeZZ38lg3W+YZ rMyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sRG0/KbibqYEE7gt4W9PdCeTiMNsbz3plnAnFI0Z+Uo=; b=Q1LBEqNIpQrH7km8zyJ/HmR5I7leCZMIGbfoyPl8kLuPelNBTFXX7oV+dGBpsYwvpM 1VESdxZXXzQajTTF5kATLncL7I826l13bzwMTWwKFT7CJaFckwLEEZ8S3kGwZo31ghHR 3RE8l5gi90zvz2pBEs2CuSgdRbaUgpEoskz5i7J/tCjhYI9kUs1n/qIl5D2pU4aUVuPO +rhTZYBGaxjlA29Yg3zsFfn4+unB0ZqckcZCijgdifKcupfmR4RKhIEo22RX85FjZo2C KlO9qri1xNtDIwyV053OGQBzBGDUz2vmjGud68XdgEHc8n1LQNGcOSWjI3s8SsDJiU7d 7aTA== X-Gm-Message-State: AOAM532EB+0WSrtC98HF1W6ksV1GP//K5jR/W5+FzBQSxdQvjJq4bv1S +rULVb9ZG71kWRIHpXcFfsy5Uw6E9JUVig== X-Google-Smtp-Source: ABdhPJzeKtuJWSbeU/Hw3VMgegsjqnUgfKDsvXpCg+OWzuBwZDqvS2My/FHFpXvhCdWXbXD6b5xzfA== X-Received: by 2002:a37:9586:: with SMTP id x128mr9876157qkd.312.1590438944148; Mon, 25 May 2020 13:35:44 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id d14sm5899991qkg.25.2020.05.25.13.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 13:35:43 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 5B6213006F7; Mon, 25 May 2020 16:35:41 -0400 (-04) Date: Mon, 25 May 2020 16:35:41 -0400 From: Alvaro Herrera To: Grigory Smolkin Cc: Pg Bugs Subject: Re: logical replication: could not create file "state.tmp": File exists Message-ID: <20200525203541.GA13908@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <08bbfab1-a61d-3750-fc18-4ab2c1aa7f09@postgrespro.ru> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Nov-30, Grigory Smolkin wrote: > One of my colleagues encountered an out of space condition, which broke his > logical replication setup. > It`s manifested with the following errors: > > ERROR:  could not receive data from WAL stream: ERROR:  could not create > file "pg_replslot/some_sub/state.tmp": File exists We haven't addressed this problem, have we? At least, I see that this routine still looks like this: > diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c > index 21ae8531b3..ef415b44c8 100644 > --- a/src/backend/replication/slot.c > +++ b/src/backend/replication/slot.c > @@ -1253,7 +1253,7 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel) > sprintf(tmppath, "%s/state.tmp", dir); > sprintf(path, "%s/state", dir); > > - fd = OpenTransientFile(tmppath, O_CREAT | O_EXCL | O_WRONLY | PG_BINARY); -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services