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 1pF7TH-0007XT-T1 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jan 2023 05:46:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pF7TG-00075H-PF for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jan 2023 05:46:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pF7TG-00073l-DU for pgsql-hackers@lists.postgresql.org; Tue, 10 Jan 2023 05:46:50 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pF7T9-0004Kf-ON for pgsql-hackers@lists.postgresql.org; Tue, 10 Jan 2023 05:46:49 +0000 Received: by mail-pj1-x1032.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so15276527pjj.2 for ; Mon, 09 Jan 2023 21:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=silAW1f9DJ5O7p4rUJCOwTw7iAgtJ9GJI41uUG6TMc4=; b=OSYKUSJtTNMgeS0tiaDOWN1M3hUNKe69ePN/DUhVT/lxvj+1D5bSzRuRDxm2OvjYGq jLe17T7cGGpVQnUbMr+UIs54/wBYroIDbFes4iRQnKnfgeKL2IAipZGsCOXZCjpuOBoT TY5uMtgiznzbxVpYwPjYiJXr4NFIPjFlPvipUPTWUinZYZg7KFcB5/bPzqnNW/Xy+mQP 4SmzdE19nHm3hr8Gaa4M44x+1Y2kWMntbZJZ4k1m0JWITfZprsDbvS3uA93NYxL/ooc/ 7lAP5WM1HcS3QX4kBNqTrOJ1DrWwiPxGfBx5zjwezkJttWXHcvblvPDRz/6ed3gHV9Oe SX2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=silAW1f9DJ5O7p4rUJCOwTw7iAgtJ9GJI41uUG6TMc4=; b=ZipJ/4ySv3i95t3vhX5cLzvGJwls7jRBOlMR+j/kG/S+a6SHKHQkOQ26V9gwd4Rnli GItLsoIq2s4sxGXwHmhNRJAfKyoYDaSlDbiZgblQmyZBuLD0ceCflSEBLi4jLW949Ntb ZwLDjhdVEzd5OR7nByflkGKjrKalOh0EGwrg86T6EZ2DWAaIUv+IUtOtxP37hJ4pXAdX EUtoCQE/hCpjrw9O9FliJ4OBaUSnkTVGdyYNU2gltd2FbGqZfTaETQeNcMGxVdye/HCq KYqBDf+t3T98Sg/nOVlk7b49JDZXVjPMeKnKUNEPRePGUziIfC6pzb4dx9MHdfSSluEY lgZg== X-Gm-Message-State: AFqh2kpM+G8SgSey8SL5+tnLBEzJTdTlatF7S9J3AblpmqIQXaNPXfpq LY41wi5xQtVac2h4X20YxjM= X-Google-Smtp-Source: AMrXdXshcLd9n6KxPP6PcVZAwbRSOb2J3zR6qfKtt9Yaiv/A4Oz/0cJF7xD62b5dzWEA4VTYoZTT6w== X-Received: by 2002:a17:902:a5c1:b0:189:62fd:140e with SMTP id t1-20020a170902a5c100b0018962fd140emr66835091plq.29.1673329602347; Mon, 09 Jan 2023 21:46:42 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id z11-20020a1709027e8b00b001769e6d4fafsm7116732pla.57.2023.01.09.21.46.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 21:46:41 -0800 (PST) Date: Tue, 10 Jan 2023 14:46:38 +0900 (JST) Message-Id: <20230110.144638.1087113443723851718.horikyota.ntt@gmail.com> To: amit.kapila16@gmail.com Cc: houzj.fnst@fujitsu.com, sawada.mshk@gmail.com, wangw.fnst@fujitsu.com, smithpb2250@gmail.com, shiy.fnst@fujitsu.com, pgsql-hackers@lists.postgresql.org, dilipbalaut@gmail.com Subject: Re: Perform streaming logical transactions by background workers and parallel apply From: Kyotaro Horiguchi In-Reply-To: References: User-Agent: Mew version 6.8 on Emacs 26.1 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 Hello. At Mon, 9 Jan 2023 14:21:03 +0530, Amit Kapila wrote in > Pushed the first (0001) patch. It added the following error message. + seg = dsm_attach(handle); + if (!seg) + ereport(ERROR, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("unable to map dynamic shared memory segment"))); On the other hand we already have the following one in parallel.c (another in pg_prewarm) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("could not map dynamic shared memory segment"))); Although I don't see a technical difference between the two, all the other occurances including the just above (except test_shm_mq) use "could not". A faint memory in my non-durable memory tells me that we have a policy that we use "can/could not" than "unable". (Mmm. I find ones in StartBackgroundWorker and sepgsql_client_auth.) Shouldn't we use the latter than the former? If that's true, it seems to me that test_shm_mq also needs the same amendment to avoid the same mistake in future. ===== index 2e5914d5d9..a2d7474ed4 100644 --- a/src/backend/replication/logical/applyparallelworker.c +++ b/src/backend/replication/logical/applyparallelworker.c @@ -891,7 +891,7 @@ ParallelApplyWorkerMain(Datum main_arg) if (!seg) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("unable to map dynamic shared memory segment"))); + errmsg("could not map dynamic shared memory segment"))); toc = shm_toc_attach(PG_LOGICAL_APPLY_SHM_MAGIC, dsm_segment_address(seg)); if (!toc) diff --git a/src/test/modules/test_shm_mq/worker.c b/src/test/modules/test_shm_mq/worker.c index 8807727337..005b56023b 100644 --- a/src/test/modules/test_shm_mq/worker.c +++ b/src/test/modules/test_shm_mq/worker.c @@ -81,7 +81,7 @@ test_shm_mq_main(Datum main_arg) if (seg == NULL) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("unable to map dynamic shared memory segment"))); + errmsg("could not map dynamic shared memory segment"))); toc = shm_toc_attach(PG_TEST_SHM_MQ_MAGIC, dsm_segment_address(seg)); if (toc == NULL) ereport(ERROR, ===== regards. -- Kyotaro Horiguchi NTT Open Source Software Center