postgres.git / summary / log / commit / refs

commit    4bcb3946249cbeed157ffd545a804913cfce749b
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Wed May 28 02:01:13 2014 +0000

    Propagate system identifier generation improvement into pg_resetxlog.
    
    Commit 5035701e07e8bd395aa878465a102afd7b74e8c3 improved xlog.c's method
    for creating a database system identifier, but I neglected to fix the
    copy of that code appearing in pg_resetxlog.c.  Spotted by Andres Freund.


src/bin/pg_resetxlog/pg_resetxlog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c index 8671c0a4a3d..d11280e1d4d 100644 --- a/src/bin/pg_resetxlog/pg_resetxlog.c +++ b/src/bin/pg_resetxlog/pg_resetxlog.c @@ -492,7 +492,8 @@ GuessControlValues(void) */ gettimeofday(&tv, NULL); sysidentifier = ((uint64) tv.tv_sec) << 32; - sysidentifier |= (uint32) (tv.tv_sec | tv.tv_usec); + sysidentifier |= ((uint64) tv.tv_usec) << 12; + sysidentifier |= getpid() & 0xFFF; ControlFile.system_identifier = sysidentifier; [parent: 49cf2cd815d6]