Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMO53-002HRZ-T3 for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Jul 2023 07:28:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qMO52-0024Hb-Ax for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Jul 2023 07:28:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMO52-0024HT-2W for pgsql-bugs@lists.postgresql.org; Thu, 20 Jul 2023 07:28:08 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qMO4z-000bWF-HW for pgsql-bugs@lists.postgresql.org; Thu, 20 Jul 2023 07:28:07 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1b8b318c5a7so3444315ad.3 for ; Thu, 20 Jul 2023 00:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689838084; x=1690442884; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=iZew1a0LDG6l7dk7JQigjCScjr0F82DBIDBd0YkVrho=; b=PMNeQb9CKGcZolJI3drLXIuWEhXhAr9pT/S2UOLAInDn3w80VL3enCQoRN1zy8Wvps WzWwVeNZIWlVDPpk/Kea3uuOV4niv7b/dO3kI+ZFoiQv3b2NrHClXOKnon1dXQ1F00r2 Kl9YQqBuJcgJpEVStcrKjgoe9LuhPZsjdIGp7omsuYKCdPG5PO4J5HrFVPzE6NVRfMq7 5ATBRZ/BIvTgYUZtTCcZ9dLEneC9T3tEizGSzn0R4xhaMAq4dBlx0myrqGrymigl/sFZ M1A52yQl3E6hVUgFxXjHxeTQfGNvQxrEJWeGD65cktjmSIl8U+//q2AYLCk7JRw6NbtO dEAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689838084; x=1690442884; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iZew1a0LDG6l7dk7JQigjCScjr0F82DBIDBd0YkVrho=; b=a4qiZx3jxZ8xHLhs7hsgkQS7cnxFI5SSmU4vwYavU3x2uPoOUKKA299TxYj93AG4Fs SR8tMvExowfJ2N7pSdxvpvc24Vlr2UCnx+bRHZHQyaI6noENPkH/nnDFjtAwYJWKCh89 3tZ32ZFTvymm1AxtyAxYjIGQCvmFkIf4kt3CuLfcRfrqgFYj0MFmbERVHFrjmI5hiYqj ud0iK13FFh7Yv57epqFdOZ8sQZVFvuD+L2P02tGumEA6fgrSgM/TICKYxrcUiefdP7Ht HGVAdwllDi3Y6+XXNTaCkoIq2r42O++pt/jEYW2JNAzAB1gHrw0GGe4CTaxAqtKEhL+p 6c8Q== X-Gm-Message-State: ABy/qLb3pf3f+/DfGRp76C2hzJYedaTXvSgTUguYqRFIeyGOoHGgtZzo PfN5WkbTzZxXpJy2Jqk9s8k= X-Google-Smtp-Source: APBJJlEqmYVbEaezQeHzOni98NhbYRReflHcGNw70vjMEglDDIoK+XAN8udPRDrMmd2pXUAMO+pDtg== X-Received: by 2002:a17:903:234e:b0:1bb:428c:fcef with SMTP id c14-20020a170903234e00b001bb428cfcefmr8208222plh.19.1689838084520; Thu, 20 Jul 2023 00:28:04 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b001ab39cd875csm533799plg.133.2023.07.20.00.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 00:28:04 -0700 (PDT) Date: Thu, 20 Jul 2023 16:28:02 +0900 (JST) Message-Id: <20230720.162802.905550494964943231.horikyota.ntt@gmail.com> To: exclusion@gmail.com Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18014: Releasing catcache entries makes schema_to_xmlschema() fail when parallel workers are used From: Kyotaro Horiguchi In-Reply-To: References: <18014-28c81cb79d44295d@postgresql.org> User-Agent: Mew version 6.8 on Emacs 27.2 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Sun, 16 Jul 2023 23:00:01 +0300, Alexander Lakhin wrote in > The parallel worker doesn't have a lock on pg_class_oid_index before > executing the query, so it gets the lock and res == LOCKACQUIRE_OK > (not > LOCKACQUIRE_ALREADY_CLEAR as in a regular backend case), after that it > processes invalidation messages (this can make the backend use a newer > catalog snapshot), and at the end it does systable_endscan() -> > index_close() -> UnlockRelationId() -> LockRelease()... > Thus, on a next iteration it gets the lock anew, with the res == > LOCKACQUIRE_OK > again, and all that ceremony repeated. > > It's not clear to me, whether this parallel worker behavior is > expected and > if so, what to fix to avoid the test failure. That is, the function is not parallel-safe. In fact it is marked as 'r' in pg_proc.proparallel. So, the real question appears to be how it ended up running in a paralell worker. regards. -- Kyotaro Horiguchi NTT Open Source Software Center