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 1hzY65-0003qw-Ex for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Aug 2019 03:12:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hzY54-00020P-A3 for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Aug 2019 03:11:38 +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 1hzY53-00020I-Uw for pgsql-bugs@lists.postgresql.org; Mon, 19 Aug 2019 03:11:38 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzY4w-0000xy-MS for pgsql-bugs@lists.postgresql.org; Mon, 19 Aug 2019 03:11:37 +0000 Received: by mail-qk1-x743.google.com with SMTP id g17so312230qkk.8 for ; Sun, 18 Aug 2019 20:11:29 -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=aaVcY9J2aqnphFxPce2wHzIPeJplPmG1KN/6iXKHxlI=; b=aN4LjM54cVR+ov2HlBsME+rqkQ8RQw2juPW8W3sLm/7+f2/1oVdv1n5zW2lYz6aliA jZzsWzP7mPUtR6mS157WR8q6dAhnT2krqEaT9/dAQxHfWUOTrZAmzy6Pg4gCd22L6hPD GejRD+Rn5UXq+U9sSh8cF0rQaQCdAjCAIeULKprRwliuKcVEK2/hTPvn6rVHT6KE5bpg 6Rrz02FngwK/dO/rQf8RbhplX0bpD2S9ATplUk9NEWJeSMpT3GNT6nyjn8nGlkJIvuor CLXqzfmwyMKLEzLXOpCzwhioiF3ZXibQUC9Z+bU/iy7Pi8FrTsfueGVoezvi7nA+X+Y/ k7Xg== 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=aaVcY9J2aqnphFxPce2wHzIPeJplPmG1KN/6iXKHxlI=; b=VEHDUIwZwb6Wt6pzvgB+O6TZDll3CeUak09PL3Nm61RcaLIdz5EwCC3vf6aNX5txF2 4D8DMjwWep1myxQ6SdqZWzWjkPU5zf5yBP5hjV7xzykDPbaRJ+KFsoJ3PQpGCQJrVmVJ Bj79bmHCGh9PDdssa7VWfKNpisMvGWVHgnIsYTQOqQLY6kmiynItkFBjEgSfcR4ve7Xb 7ZcPfAQUoON8O/CRaM8fFz+2G0oFqmxZrqoDX2LLNRRjj+nLtt8D2J67P8OQxxNg7gWx ED652dpc9kmLQzstUOhiS78k0emMUJfW9o3CkNwsODWsPAP1l5Snw/ucbbncxXzz71S/ 42Hg== X-Gm-Message-State: APjAAAXohEII7NMHWW1udLKCeK42LX+iYf/YuK3K7nqKguQFvDxWimB0 sJBmoORGUcBQZMnxLMQE0OJrkQ== X-Google-Smtp-Source: APXvYqwZHDYbTa+UrGFuaA66O4wLgFyCWl2z2FVIs4BIshlsjyzxkP13uz4odKMEJhSYyf2JAn6sog== X-Received: by 2002:a37:4997:: with SMTP id w145mr19571082qka.82.1566183806812; Sun, 18 Aug 2019 20:03:26 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([179.56.51.60]) by smtp.gmail.com with ESMTPSA id n62sm2294011qkd.124.2019.08.18.20.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2019 20:03:26 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 0C802123816; Sun, 18 Aug 2019 22:59:54 -0400 (-04) Date: Sun, 18 Aug 2019 22:59:54 -0400 From: Alvaro Herrera To: Andres Freund Cc: Tom Lane , Dilip Kumar , jungleboogie0@gmail.com, pgsql-bugs@lists.postgresql.org, Michael Paquier Subject: Re: BUG #15964: vacuumdb.c:187:10: error: use of undeclared identifier 'FD_SETSIZE' Message-ID: <20190819025953.GA15110@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190818001858.ho3ev4z57fqhs7a5@alap3.anarazel.de> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Aug-17, Andres Freund wrote: > Hm. This made me think: Why is > > if (concurrentCons > FD_SETSIZE - 1) > { > pg_log_error("too many parallel jobs requested (maximum: %d)", > FD_SETSIZE - 1); > > a useful test / error message? FD_SETSIZE is about the numerical value > of fds. There will usually be at least three fds open, starting at 0 - > but there easily can be more, depending on what the reindexdb/vacuumdb > caller is doing. Hmm ... yeah, this is clearly not perfect. In my laptop, vacuumdb -j 1021 works; 1022 and 1023 fail like this after opening a number of conns: vacuumdb: vacuuming database "alvherre" vacuumdb: error: could not connect to database alvherre: could not look up local user ID 1000: Too many open files and 1024 fails like this immediately on start: vacuumdb: error: too many parallel jobs requested (maximum: 1023) After 'ulimit -n 1200', vacuumdb -j1023 fails like this: vacuumdb: vacuuming database "alvherre" *** buffer overflow detected ***: vacuumdb terminated Aborted So I agree that we need a fix. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services