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 1pVaUR-0003s0-RK for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Feb 2023 16:00:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pVaUQ-0001fl-DW for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Feb 2023 16:00:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVaUQ-0001ZO-1r for pgsql-bugs@lists.postgresql.org; Fri, 24 Feb 2023 16:00:06 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pVaUN-00032L-VU for pgsql-bugs@lists.postgresql.org; Fri, 24 Feb 2023 16:00:05 +0000 Received: by mail-lf1-x132.google.com with SMTP id bi9so4338185lfb.2 for ; Fri, 24 Feb 2023 08:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=O1IuHhOtE6huy1zrr01Bc9qWqc3E9PZ94IA2tQJ8wFQ=; b=p7m7uV7lu6RVfTClloFJBAga7KMIu6b7+ZwwKijhGYovzAAnSE8+6kkqA4cryZRqSw SMnfIM49bmJG9B3S02R/eTnfN1O9HlrdVRbJZnsYUtGhKBzALG3B9jL2qjeWeutitqPz cZ48KwuxkgMUNN8B84vxUcJZ8mfqyATT2XFdBeAiu2C/3P63sy+BWROgpggViFozp8Vd 4k0YiYF7gT4e8vAWI1AlqjkhufYS+bm9hdAnSZOHXgDJEAM50WZWIWzpeUkoO7OxnfsH fO5GM4qPyo5Fnlzs4St8OfH679AY1GmyGSzpBx6gGi9q9XRmX7o48m0kNugEn0QEv7nu IweQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O1IuHhOtE6huy1zrr01Bc9qWqc3E9PZ94IA2tQJ8wFQ=; b=hHAVB1yv7/W6ThEBg1oEUZZPKxnrs72CYb/LuW2fXYh/9xvpeapusK+nrnYRJGE1d6 bABtmcHVEl5G76QAwlwKXZljl8tgUrWH+4CH30T06Q7zbdeIpXzETYX8+GKEzR7pdi9q unfsufK0SFONNf70SnPB3KONQY2DnjuoiyQRm6MCjFETogkBHJwnqGn6nizCWmvPt4qe 1WEY0mc8LtNH5WpTKHvUziJ1Ni2RHzzlDSbh8Jh8fW5yNDryx4D9iM8CnSsSou3CKODN jN7hqXEBs+tJLZjS5/sI9HLnc1NlaDMpcIkYD5rKpis59OW97Uz71ialCfSTvYaP8df2 xbAw== X-Gm-Message-State: AO0yUKUzdJqGM0X44qqnz/W0Deq7yKw7XWTdIMvz0gS/nCrsb4J63Abb ObOuDPP6k6aaUk81nRi5fEM= X-Google-Smtp-Source: AK7set/iMI7lL3HBewyAYmeiYxX1Em+702bd/UwA4WDClGFpFPH0sULwSzxHEJZM8yO0PFPrpmxGOQ== X-Received: by 2002:a05:6512:3e16:b0:4d8:86c1:478c with SMTP id i22-20020a0565123e1600b004d886c1478cmr32817lfv.33.1677254402795; Fri, 24 Feb 2023 08:00:02 -0800 (PST) Received: from [1.0.0.7] ([178.155.5.178]) by smtp.gmail.com with ESMTPSA id 25-20020ac25699000000b004b5774726dcsm1391344lfr.236.2023.02.24.08.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Feb 2023 08:00:01 -0800 (PST) Message-ID: <1836967a-9f78-aed8-1ff1-3351c504e8f0@gmail.com> Date: Fri, 24 Feb 2023 19:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #17804: Assertion failed in pg_stat after fetching from pg_stat_database and switching cache->snapshot Content-Language: en-US To: Kyotaro Horiguchi , pgsql-bugs@lists.postgresql.org References: <17804-2a118cd046f2d0e5@postgresql.org> <20230224.160812.1001813717917457753.horikyota.ntt@gmail.com> From: Alexander Lakhin In-Reply-To: <20230224.160812.1001813717917457753.horikyota.ntt@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Kyotaro-san, 24.02.2023 10:08, Kyotaro Horiguchi wrote: > Thanks for the report! We didn't consider the case that variable is > changed in-transaction. > > > What are your thoughts on this? What if we implement assign_pgstat_fetch_consistency() and execute pgstat_clear_snapshot() in it when the mode switch happens (to avoid possible inconsistency between the GUC and the current pgstat state)? If snapshots in different modes contain different data sets, will such behaviour be unexpected for a user? For example, if a user performs: SET LOCAL stats_fetch_consistency = snapshot; {some-actions-1} SET LOCAL stats_fetch_consistency = none; {some-actions-2} SET LOCAL stats_fetch_consistency = snapshot; {some-actions-3} Should she expect that some-actions-1, some-actions-2 will be reflected in the snapshot at the end? Best regards, Alexander