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 1mGEWq-0004MO-V5 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Aug 2021 05:54:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mGEWp-0002IV-2B for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Aug 2021 05:54:19 +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 1mGEWo-0002IN-P0 for pgsql-hackers@lists.postgresql.org; Wed, 18 Aug 2021 05:54:18 +0000 Received: from mail-yb1-xb2f.google.com ([2607:f8b0:4864:20::b2f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mGEWk-0002lK-C9 for pgsql-hackers@postgresql.org; Wed, 18 Aug 2021 05:54:18 +0000 Received: by mail-yb1-xb2f.google.com with SMTP id z18so3017598ybg.8 for ; Tue, 17 Aug 2021 22:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rdW5Fm/KommXyNkKo9HN/kWaexynAFFI8jwqCUH6Bpo=; b=H07Y4Oolhwn4TJJv5826WJ3i0XTdi7Ckp4SRHbKaIIFCZkswfdAnJjPp7ZSxoDUYRY KI9h34W9Bv0j9ketM5nPDIZ1eVrInAHaggf5mnQXU7TxvxsdotIAihWPitWgtE5LF103 Zb1pgz9ewgggWweJmVUr9Qpq63EBWUcVmPT8KUAr/9eE+kd/piqyuWjc7yTOLJgnP2FY E9erABXk3juu4w+v9306QKGCGK95PVv3rrnTR4Y9Xu+ts7JTsz5p44aP7+QOrlgygklt 4kEFOwLGUzBimo6zlpttNl6aIL/nZHjuFMz2Au5/vbVkyjbF1FLBIKxlxkjobz4Uhx1A hUQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rdW5Fm/KommXyNkKo9HN/kWaexynAFFI8jwqCUH6Bpo=; b=GejM1hFgSaFDYG6A03EEkeEPPnCWS1NL+SNoxDxgg0oL1r//N1MPM6S5WDbYAjizQ4 tJQVb45XFehDlNFBAn+Dakou+HxAta+Yr8eohp20AppaasvbovVAaLTEEpoDrVPCgolm 8ZAf2YIgrAsmaXUIOi0vp4kLDj2BqHk2kwWcqeHWjpyWzcCQ6wTx0kC+edZ3XuqmdStN bDyspvcL5BsQYSjJPSI4G5pU4VITKxCC4PCWsEDxXlcCHgzCsrsK1d6G+WWcaht8oP1t w3QVwlNEPjVZL5tgc+2UnbBsUy7Epchy9QpLqD3YgzmQ7AfXj3yO5NKsXlxy2DgOZ7d6 qQXg== X-Gm-Message-State: AOAM531xWL3+mC1r/1tqG33QOEqfEZEi4aUvP55LO8YodmG2YEKYCGHK cbumchLd+kstwd62nqXtHBGfysN6eE9NGYFUhgs= X-Google-Smtp-Source: ABdhPJwqcPifBKPal8y4q1qGefwBVrbwc24LvAMuXXDPbLHnY9ZG8Bj1YpVUKhFtZTItD3GabgRpUW6yknJ8PwbZXGE= X-Received: by 2002:a25:6e45:: with SMTP id j66mr8984313ybc.449.1629266052365; Tue, 17 Aug 2021 22:54:12 -0700 (PDT) MIME-Version: 1.0 References: <20210812082237.in7l5x3rc4gxhgjh@alap3.anarazel.de> <20210812124819.5mrurb6ueizmqgru@alap3.anarazel.de> <20210813155940.kp7mdg3ynl2hodqk@alap3.anarazel.de> <20210817110427.yd5i7iostgqf5gvt@alap3.anarazel.de> In-Reply-To: <20210817110427.yd5i7iostgqf5gvt@alap3.anarazel.de> From: Amit Kapila Date: Wed, 18 Aug 2021 11:24:01 +0530 Message-ID: Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o To: Andres Freund Cc: Dilip Kumar , Thomas Munro , pgsql-hackers , Masahiko Sawada , Tom Lane Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 17, 2021 at 4:34 PM Andres Freund wrote: > > On 2021-08-17 10:54:30 +0530, Amit Kapila wrote: > > 5. How can we provide a strict mechanism to not allow to use dsm APIs > > for non-dsm FileSet? One idea could be that we can have a variable > > (probably bool) in SharedFileSet structure which will be initialized > > in SharedFileSetInit based on whether the caller has provided dsm > > segment. Then in other DSM-based APIs, we can check if it is used for > > the wrong type. > > Well, isn't the issue here that it's not a shared file set in case you > explicitly don't want to share it? ISTM that the proper way to address > this would be to split out a FileSet from SharedFileSet that's then used > for worker.c and sharedfileset.c. > Okay, but note that to accomplish the same, we need to tweak the BufFile (buffile.c) APIs as well so that they can work with FileSet. As per the initial analysis, there doesn't seem to be any problem with that though. -- With Regards, Amit Kapila.