Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iN2GF-0005aZ-0W for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2019 22:04:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iN2GC-0003Qi-7J for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2019 22:04:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iN2GB-0003Q6-RG for pgsql-hackers@lists.postgresql.org; Tue, 22 Oct 2019 22:04:11 +0000 Received: from mail-io1-xd43.google.com ([2607:f8b0:4864:20::d43]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iN2G4-0001ZP-2C for pgsql-hackers@postgresql.org; Tue, 22 Oct 2019 22:04:10 +0000 Received: by mail-io1-xd43.google.com with SMTP id p6so14182286iod.7 for ; Tue, 22 Oct 2019 15:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=k6VQ4Gb0j1fdP0KtIXgOcceQ9nYfNcx8pe78UAPtDiQ=; b=uy0FB6wY+Rr62h3MHubI8LTK7ydmeRhv11k0l57at3LaObtKV3ffMN0fib3hQsphYq 0nyO0kXNHVtVMxQe3O8WDLGng/1vo2CjzAjrs4qiDal+jZES8h/mbdnnkp5Kgtbz6cv+ clC0pKjXgjioqBFl0jrJ+dNdl1peAqy/yBWEPrxuA7sRtLcUAxjGfhp1NX9T6VzFrsks dYJe008CheAzg3gpfD77rPtimm7WQ4O6Su03XK2u7NRy1mHcJA1dYBlsZPhMC7UYbqli aNPpqUFIuXdfS8nVYa7Q+VB+PtYBYDR48QItbe4xgOOJAWlyFw35bL20Bk5rdRj+Gpq5 4OTw== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=k6VQ4Gb0j1fdP0KtIXgOcceQ9nYfNcx8pe78UAPtDiQ=; b=kkSw72n1uBW84rDpW0XrUF1H4gqXKTl0SEYQ6YDFGwuCR+jk0JFESCsrjYbvksFuSG v2Nfl1gcCMCUs5KoI0SqewWR65jQIYHbT5AjBY2IyYrHoIthaKqPWeg5K4xuQiNhe6Do l+zG8U7HEy0vn9zkY/DBeCMBSNPAeGUx0LGbZ9o4p3FOgNvDO3sN6i1YI4qxnMN9g0MQ aiNzOREyAhnpUAKV9lJoC3VrX/W8qarkr0JpsI4DaLStjdLObH/MtPjXxpFw0SzGt1nf 2j7maW2CDrjwHNL7Ga0FwszN2fEUPLdvNOUZyDh04sXHx4vVRRfYhwgwCUBxp9WBBet6 78uA== X-Gm-Message-State: APjAAAUaBbONh/80foXFNETttSwHnGKP8Gy7eGNlVol/NRBYf6rh22N/ RK3ePSiBHnpHR3FvN1dVcMhbKw== X-Google-Smtp-Source: APXvYqz1athH1Pm/bu6M1QsWjZvryocjX+KAxZtJ4Og4pwYfqfjVtgSau6Cvn6wi+b/b6D4eQc30QQ== X-Received: by 2002:a5d:87c4:: with SMTP id q4mr6164ios.136.1571781841483; Tue, 22 Oct 2019 15:04:01 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 133sm4532443ila.25.2019.10.22.15.03.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Oct 2019 15:03:59 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 9DA10801497; Tue, 22 Oct 2019 17:03:58 -0500 (CDT) Date: Tue, 22 Oct 2019 17:03:58 -0500 From: Justin Pryzby To: pgsql-hackers@postgresql.org Cc: Thomas Munro Subject: Re: stress test for parallel workers Message-ID: <20191022220358.GA29301@telsasoft.com> References: <20190723162703.GM22387@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190723162703.GM22387@telsasoft.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I want to give some conclusion to our occurance of this, which now I think was neither an instance nor indicitive of any bug. Summary: postgres was being kill -9 by a deployment script, after it "timed out". Thus no log messages. I initially experienced this while testing migration of a customer's DB using an ansible script, which did "async: 2222, poll: 0". Which I guess it takes to mean "let the process run for 2222 seconds, after which send it SIGKILL". I probably made multiple attempts to migrate (for example to fix tablespaces or dependences on postgis), and the process was started during one test and never stopped nor restarted during following tests, until it finally hit 2222sec and stopped ungracefully. This just happened again, during a differnet migration, so I reproduced it like: ansible --sudo --sudo-user pryzbyj 'database.customer.*' --background=1 --poll=1 -m command -a '/usr/pgsql-12/bin/postmaster -D /home/pryzbyj/pg12.dat -c port=5678 -c unix-socket-directories=/tmp -c client_min_messages=debug -c log_temp_files=0 -c log_lock_waits=1' Connect to customer and verify it was killed uncleanly: [pryzbyj@database ~]$ /usr/pgsql-12/bin/postmaster -D ./pg12.dat -c port=5678 -c unix-socket-directories=/tmp -c client_min_messages=debug -c log_temp_files=0 -c log_lock_waits=1 -c logging_collector=off 2019-10-22 17:57:58.251 EDT [5895] FATAL: lock file "postmaster.pid" already exists 2019-10-22 17:57:58.251 EDT [5895] HINT: Is another postmaster (PID 5608) running in data directory "/home/pryzbyj/./pg12.dat"? [pryzbyj@database ~]$ /usr/pgsql-12/bin/postmaster -D ./pg12.dat -c port=5678 -c unix-socket-directories=/tmp -c client_min_messages=debug -c log_temp_files=0 -c log_lock_waits=1 -c logging_collector=off 2019-10-22 17:58:01.312 EDT [5962] LOG: starting PostgreSQL 12.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit 2019-10-22 17:58:01.312 EDT [5962] LOG: listening on IPv6 address "::1", port 5678 2019-10-22 17:58:01.312 EDT [5962] LOG: listening on IPv4 address "127.0.0.1", port 5678 2019-10-22 17:58:01.328 EDT [5962] LOG: listening on Unix socket "/tmp/.s.PGSQL.5678" 2019-10-22 17:58:01.353 EDT [5963] LOG: database system was interrupted; last known up at 2019-10-22 17:57:48 EDT 2019-10-22 17:58:01.460 EDT [5963] LOG: database system was not properly shut down; automatic recovery in progress 2019-10-22 17:58:01.478 EDT [5963] LOG: invalid record length at 6/E829D128: wanted 24, got 0 2019-10-22 17:58:01.478 EDT [5963] LOG: redo is not required 2019-10-22 17:58:01.526 EDT [5962] LOG: database system is ready to accept connections On Tue, Jul 23, 2019 at 11:27:03AM -0500, Justin Pryzby wrote: > Does anyone have a stress test for parallel workers ? > > On a customer's new VM, I got this several times while (trying to) migrate their DB: > > < 2019-07-23 10:33:51.552 CDT postgres >FATAL: postmaster exited during a parallel transaction > < 2019-07-23 10:33:51.552 CDT postgres >STATEMENT: CREATE UNIQUE INDEX unused0_huawei_umts_nodeb_locell_201907_unique_idx ON child.unused0_huawei_umts_nodeb_locell_201907 USING btree ... > > There's nothing in dmesg nor in postgres logs. > > At first I thought it's maybe because of a network disconnection, then I > thought it's because we ran out of space (wal), then they had a faulty blade. > After that, I'd tried and failed to reproduce it a number of times, but it's > just recurred during what was intended to be their final restore. I've set > max_parallel_workers_per_gather=0, but I'm planning to try to diagnose an issue > in another instance. Ideally a minimal test, since I'm apparently going to > have to run under gdb to see how it's dying, or even what process is failing. > > DMI: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 09/21/2015 > CentOS release 6.9 (Final) > Linux alextelsasrv01 2.6.32-754.17.1.el6.x86_64 #1 SMP Tue Jul 2 12:42:48 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux > version | PostgreSQL 11.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23), 64-bit