pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Ildar Musin <i.musin@postgrespro.ru>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: IndexTupleDSize macro seems redundant
Date: Thu, 11 Jan 2018 13:26:27 -0500
Message-ID: <10582.1515695187@sss.pgh.pa.us> (raw)
In-Reply-To: <20180111181713.GN2416@tamriel.snowman.net>
References: <0274288e-9e88-13b6-c61c-7b36928bf221@postgrespro.ru>
	<CAA4eK1+qNuT2iY+gL-yi-Sn-aj=2y7hBD3GFFRrxh6hV-U+X6w@mail.gmail.com>
	<CA+TgmoaBZi-oNU4dK-FBDeqRWijxYKc5Lne2hD7+bn+sXKuT3g@mail.gmail.com>
	<20180111172241.GK2416@tamriel.snowman.net>
	<8984.1515692863@sss.pgh.pa.us>
	<20180111181713.GN2416@tamriel.snowman.net>

Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> I'm on board with Stephen's changes, except in _bt_restore_page.
>> The issue there is that the "from" pointer isn't necessarily adequately
>> aligned to be considered an IndexTuple pointer; that's why we're doing
>> the memcpy dance to get a length out of it.

> I certainly hadn't been thinking about that.  I didn't see any
> issues in my testing (where I created a table with a btree index and
> insert'd a bunch of records into and then killed the server, forcing WAL
> replay and then checked that the index appeared to be valid using order
> by queries; perhaps I should have tried amcheck, but doesn't sound like
> this is something that would have been guaranteed to break anyway).

You wouldn't see a problem, unless you tested on alignment-picky
hardware, ie, not Intel.

I wonder whether there is a way to get alignment traps on Intel-type
hardware.  It's getting less and less likely that most hackers are
developing on anything else, so that we don't see gotchas of this
type until code hits the buildfarm (and even then, only if the case
is actually exercised in regression testing).

			regards, tom lane




view thread (15+ messages)  latest in thread

Message-ID: <10582.1515695187@sss.pgh.pa.us>
Permalink:  ../10582.1515695187@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10582.1515695187@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sfrost@snowman.net, robertmhaas@gmail.com, amit.kapila16@gmail.com, i.musin@postgrespro.ru
  Subject: Re: IndexTupleDSize macro seems redundant
  In-Reply-To: <10582.1515695187@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox