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 1gwpNJ-0006et-0g for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Feb 2019 14:30:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gwpNH-0001j1-Lr for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Feb 2019 14:30:55 +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 1gwpNH-0001iu-AG for pgsql-hackers@lists.postgresql.org; Thu, 21 Feb 2019 14:30:55 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gwpNE-0000Rj-ED for pgsql-hackers@postgresql.org; Thu, 21 Feb 2019 14:30:54 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id D7C2221CC5A5; Thu, 21 Feb 2019 17:30:50 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.237] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 83CA721C9DFF; Thu, 21 Feb 2019 17:30:50 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1550759450; bh=gAuWnxfV6O5HIb+akV8D44BEd/nYaNoix6nTIiGIs+E=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=WqoIEQVC38ZZzNQeoG1y0h1sochmvE2vEQdGtfhqdeL5lPaJmLZWVFiCps9k3BHa5 bHHWAoIYsnU8Aaj5c0wv2dOShxTHh7JRp2SaI9yPBcfwMeqXR54NLRwSeXuaRRvlr/ DLL8CtV9a0QlPbTaeBWwYs48wLsmV8OO0z+ppyio= Subject: Re: shared-memory based stats collector To: Kyotaro HORIGUCHI , alvherre@2ndquadrant.com Cc: andres@anarazel.de, tomas.vondra@2ndquadrant.com, ah@cybertec.at, magnus@hagander.net, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org References: <20190215171655.ioxlfm5a2rrl6dzv@alap3.anarazel.de> <20190215185328.GA29663@alvherre.pgsql> <20190220.154517.24528798.horiguchi.kyotaro@lab.ntt.co.jp> <20190221.160555.191280262.horiguchi.kyotaro@lab.ntt.co.jp> From: Arthur Zakirov Message-ID: Date: Thu, 21 Feb 2019 17:30:50 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190221.160555.191280262.horiguchi.kyotaro@lab.ntt.co.jp> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, On 21.02.2019 10:05, Kyotaro HORIGUCHI wrote: > Done. This verison 16 looks as if the moving and splitting were > not happen. Major changes are: > > - Restored old pgstats_* names. This largily shrinks the patch > size to less than a half lines of v15. More than that, it > gets easier to examine differences. (checkpointer.c and > bgwriter.c have a bit stale comments but it is an issue for > later.) > > - Removed "oneshot" feature at all. This simplifies pgstat API > and let this patch far less simple. > > - Moved StatsLock to LWTRANCHE_STATS, which is not necessary to > be in the main tranche. > > - Fixed several bugs revealed by the shrinked size of the patch. I run regression tests. Unfortunately tests didn't pass, failed test is 'rangetypes': rangetypes ... FAILED (test process exited with exit code 2) It seems to me that an autovacuum process terminates because of segfault. Segfault occurs within get_pgstat_tabentry_relid(). If I'm not mistaken, somehow 'dbentry' hasn't valid pointer anymore. 'dbentry' is get in the line in do_autovacuum(): dbentry = pgstat_fetch_stat_dbentry(MyDatabaseId); 'dbentry' becomes invalid after calling pgstat_vacuum_stat(). -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company