Re: small typo in src/backend/access/transam/xlog.c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: didier <did447(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: small typo in src/backend/access/transam/xlog.c
Date: 2013-07-22 19:55:46
Message-ID: CA+TgmobGkC16JrPYWX2OFgwBaaycwKkAY_CapCiqh3GW_foHWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 22, 2013 at 6:45 AM, didier <did447(at)gmail(dot)com> wrote:
> Hi
>
> in void
> BootStrapXLOG(void)
>
> * to seed it other than the system clock value...) The upper half of
> the
> * uint64 value is just the tv_sec part, while the lower half is the
> XOR
> * of tv_sec and tv_usec. This is to ensure that we don't lose
> uniqueness
> * unnecessarily if "uint64" is really only 32 bits wide. A person
> * knowing this encoding can determine the initialization time of
> the
> * installation, which could perhaps be useful sometimes.
> */
> gettimeofday(&tv, NULL);
> sysidentifier = ((uint64) tv.tv_sec) << 32;
> sysidentifier |= (uint32) (tv.tv_sec | tv.tv_usec);
>
> should be
> sysidentifier |= (uint32) (tv.tv_sec ^ tv.tv_usec);

And why is that?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-07-22 20:01:59 Re: small typo in src/backend/access/transam/xlog.c
Previous Message Karol Trzcionka 2013-07-22 19:52:14 Re: GSOC13 proposal - extend RETURNING syntax