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 1soito-00DLHd-Ht for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Sep 2024 12:26:13 +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 1soitn-006lsd-UG for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Sep 2024 12:26:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1soitn-006lsV-Ju for pgsql-hackers@lists.postgresql.org; Thu, 12 Sep 2024 12:26:11 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1soith-000nok-Vl for pgsql-hackers@lists.postgresql.org; Thu, 12 Sep 2024 12:26:10 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5c3d20eed0bso1026948a12.0 for ; Thu, 12 Sep 2024 05:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726143965; x=1726748765; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OpJZeT9zXjykEnAVqAB7XkF3xJ+cP9tMicdQi+P7Ve8=; b=lolrDpPjEzuXR7TQ69a4Zyt8RqiOPcssHUDDOzC21ag+HwKyoWSzXZ15vYBfNHIPV0 KGvB20UacU/8m6BRyF1IEpxf6jZDOlYQeBoVhv0nCL0USD+gvgRw8GPhGFXQ1tOX3NJC DQOTFDpeph4c1EIUvnRLn0H5xEJkXvBdZHlVMOklWzXTJ4A3qx4djKRYllKkZEtRrMfs cEe9g0jQq2qs2lBFBzxXM5x260uid0v98NDABUenGPFtrnu/Nq4LN0OjtBpq7X+/4HGn wtPnaw8g/ashxEthauIDh60CO0hEd1h+kCUuwktS+DRlqbNEL2WojPJsBEpAqDBQtDpr vayw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726143965; x=1726748765; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OpJZeT9zXjykEnAVqAB7XkF3xJ+cP9tMicdQi+P7Ve8=; b=VZFdNeOE35tBVO6Trj460j6h5NZIQ3Gr6PYAtHJhV2el0iJHHxQDD7Nty3rOPh5O2z CbXRC9R5PR0czvgo26wuEzjCCVEtfMu/9XJzf5Cp23nghHwQnIJ7e8/Oyvro2flnyDMo Z8uuKuWnoUZ5k+V9p7cojJGdPuDwVyKRhXoz+U6SqwQ3XozQ7C5Qi+g1or/XqPQ5in1y Y8goVHHLslBAkoRRaXqiUAQYBFrlX7nOUSJxhTHnUak28GbCKUEdhbObJwaoArDfyLEr yskUKCdPTiLDX4pd54k9MVWjx/BkBhAxW2W+I86E/w9zWo60FU49SdsQrWSxQIKf8agE 5OFA== X-Forwarded-Encrypted: i=1; AJvYcCWNfyL8x0K+Yl+55fffAFoZgIL/V9SFEyKJyxVPcH3IcoqWqTIggwlk97yAOiDiqvdnlM/MNx7wnu+CkJc6@lists.postgresql.org X-Gm-Message-State: AOJu0YzW75WDlRZr1rJVcemHv6mvkw8sDBCD8oUrKgHQTTIqkcAH5SIh mAnJY3RxwQFq+bn+TkY+1t4+jfl8eUYJxdTzUcjUlis3bwgN+ZAHauU7Nw1VSfNSw0EhwpWxJT0 ALnNbhe4KOxUS44bIPelgeBiak20= X-Google-Smtp-Source: AGHT+IFeDKAewDqY8heXtCbXDG0dzRAHWJ3FIDE+ESFak/siVeF5ANaNbkCAnJcEmGtiwbORA6pRJz1IRIzqzhRzkBA= X-Received: by 2002:a17:906:794b:b0:a86:a4b1:d2b8 with SMTP id a640c23a62f3a-a90293b1860mr240011066b.4.1726143964347; Thu, 12 Sep 2024 05:26:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pavel Borisov Date: Thu, 12 Sep 2024 16:25:53 +0400 Message-ID: Subject: Re: POC: make mxidoff 64 bits To: Maxim Orlov Cc: Alexander Korotkov , wenhui qiu , Heikki Linnakangas , Postgres hackers Content-Type: multipart/alternative; boundary="000000000000d3b1180621eb35e2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d3b1180621eb35e2 Content-Type: text/plain; charset="UTF-8" On Thu, 12 Sept 2024 at 16:09, Pavel Borisov wrote: > Hi, Maxim! > > Previously we accessed offsets in shared MultiXactState without locks as > 32-bit read is always atomic. But I'm not sure it's so when offset become > 64-bit. > E.g. GetNewMultiXactId(): > > nextOffset = MultiXactState->nextOffset; > is outside lock. > > There might be other places we do the same as well. > I think the replacement of plain assignments by pg_atomic_read_u64/pg_atomic_write_u64 would be sufficient. (The same I think is needed for the patchset [1]) [1] https://www.postgresql.org/message-id/flat/CAJ7c6TMvPz8q+nC=JoKniy7yxPzQYcCTnNFYmsDP-nnWsAOJ2g@mail.gmail.com Regards, Pavel Borisov --000000000000d3b1180621eb35e2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Regards,
Pavel Borisov
--000000000000d3b1180621eb35e2--