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 1i5IUt-00085M-D4 for pgsql-general@arkaria.postgresql.org; Tue, 03 Sep 2019 23:46:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i5IUs-0002tD-9Y for pgsql-general@arkaria.postgresql.org; Tue, 03 Sep 2019 23:46:02 +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 1i5IUr-0002pc-RU for pgsql-general@lists.postgresql.org; Tue, 03 Sep 2019 23:46:01 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5IUo-0004rc-0t for pgsql-general@postgresql.org; Tue, 03 Sep 2019 23:46:01 +0000 Received: by mail-pl1-x643.google.com with SMTP id gn20so8664051plb.2 for ; Tue, 03 Sep 2019 16:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0p0WYETMxvkJ5W800kLhpEoZT1c3PU3lijyazvq4rAM=; b=ukaclQ4LM6BB4HehP6UXe0DtavgJG0VA3aYC/dOy2KiVjahnfSS4x5rNewFHfpz78z dGwYkMmk5V2IdnCpPOxNDNX1BeQdn9OUHjqvI2zWeRrbwa9uZ6UFX5vgcdNZ/SOkJin6 3wDuYz1ThT4aKVfjTgqy+0Q03pVk4YgzAJu+z1SVb9+BIlok3p0d0T59RVCvSW3tmesd kZ5TTYugQgWSGtH/Z0W4CmsPY3w2aIe+QmTq3VBxbKIJYvlRxK6QeKC8ss7rOjU0w5tU 5bp45JoVuQ/b8ZMU8i6ukp86a9cjf1VfBmZvdkMfLX6LB8vbt9VrAkj2/b+l0v4d2uFt tn/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=0p0WYETMxvkJ5W800kLhpEoZT1c3PU3lijyazvq4rAM=; b=FY+OM++ByfFIY9Wk2dpX/PYndClCC+c0jjlkf81AcrJnqF4cxsDFF7QiVyvnsAPRxg a7zkR7Qv6GBLG1XvVGwnXU/lgxCQIs8f8NT8BxpkmdEdhhcIZzxcG3qgkMvSpjSNlqLn iQ7r8OjbGwLyRLCSh9q3jFNr8JDhiRPIw7FYEHkFAMz3bej4g3qvMq2ngNA9Qmkg6BCP PYTlMiH/8B4iuRDbvnHymKSUMMa/SDeipc/M1YL2yDdTpAV6QQTYdnIFLM1kuGFfBhGQ K93g4nS+F1i1q09+yre6zyEnp0dTH+05zQXjnz89IcYkyZHwdm2R18ZNVAwZgFNGgPra gATg== X-Gm-Message-State: APjAAAWAMgaqjb3WR4E0lDqCgKhqELJhJFYlgR+R/8+kM5V8pVgYIzOk kihFj1W4NKtCghFiKj7ia0E= X-Google-Smtp-Source: APXvYqxkV+sN73Z6Iv9vCmmT0TlyCpspNj4m1yEVnfxYpLQzEHZ0278P6fx4lN6NFvh8TH2MdW3gMA== X-Received: by 2002:a17:902:7088:: with SMTP id z8mr7615271plk.307.1567553902823; Tue, 03 Sep 2019 16:38:22 -0700 (PDT) Received: from dev.null (d64-180-144-158.bchsia.telus.net. [64.180.144.158]) by smtp.gmail.com with ESMTPSA id a5sm552627pjs.31.2019.09.03.16.38.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Sep 2019 16:38:21 -0700 (PDT) Sender: Will Storey Date: Tue, 3 Sep 2019 16:38:19 -0700 From: Will Storey To: Tom Lane Cc: Adrian Klaver , pgsql-general@postgresql.org Subject: Re: Unexpected "canceling statement due to user request" error Message-ID: <20190903233819.voaqdquwsdk3g5nm@dev.null> References: <20190816210243.tohrx52bnbxx5zra@dev.null> <34a5ea6d-8dbb-e46a-0c08-fbbea4d4bcd7@aklaver.com> <20190817181335.wc7t3z3tfs7taiqo@dev.null> <11561.1567381579@sss.pgh.pa.us> <20190902002120.jp4xjlfuvkwwksr3@dev.null> <14506.1567385910@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <14506.1567385910@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun 2019-09-01 20:58:30 -0400, Tom Lane wrote: > >> A separate question is how come the particular query you're complaining > >> about has (seemingly) a fairly wide window where it never does any > >> CHECK_FOR_INTERRUPTS call before terminating. Perhaps there's someplace > >> we need to sprinkle a few more of those. > > > Yeah, it is strange. There are many queries in this system with statement > > timeouts and this is the only one where I see this and it happens several > > times a day. > > It'd be interesting to see EXPLAIN ANALYZE output from a typical execution > of that query. Even better would be a test case (w/ tables and dummy > data) so somebody else could reproduce it; but maybe looking at EXPLAIN > ANALYZE would be enough to determine where we're missing checks. I put output from a query with values that caused the error here: https://gist.githubusercontent.com/horgh/653e60b8c2f071d859424517d653eb4e/raw/5d16e11d0ac884ed9dc120c4521e2de8f2e7c3d6/test.txt I sanitised some of the names and values again. Sorry about that. As far as a test case: I'm not sure how to reproduce it myself. It just happens periodically (15 times in the past 24 hours). The tables are somewhat large (60+ GiB per partition). I could try to generate dummy versions if you like, but they would have to be significantly dummied, so I'm not sure it would end up being representative.