Re: Set new system identifier using pg_resetxlog - Mailing list pgsql-hackers

From Sawada Masahiko
Subject Re: Set new system identifier using pg_resetxlog
Date
Msg-id CAD21AoBqjKQ7+EX2Q51PL2GZyqvkaFxAgw-N3HG0jQco4ZS+Kg@mail.gmail.com
Whole thread Raw
In response to Re: Set new system identifier using pg_resetxlog  (Petr Jelinek <petr@2ndquadrant.com>)
Responses Re: Set new system identifier using pg_resetxlog  (Petr Jelinek <petr@2ndquadrant.com>)
List pgsql-hackers
<font><span style="background-color:rgba(255,255,255,0)">Thank you for updating the patch.<br />I think that the
followingbehaviour of pg_resetxlog is bug.<br /><br />$ pg_controldata data | grep "Database system identifier"<br />
Databasesystem identifier:           6029284919152642525<br /><br />--<br />$ pg_resetxlog -s0 -n data<br />Current
pg_controlvalues:<br /><br />pg_control version number:            942<br />Catalog version number:               <a
href="tel:201406181">201406181</a><br/> Database system identifier:           6029284919152642525<br />Latest
checkpoint'sTimeLineID:       1<br />Latest checkpoint's full_page_writes: on<br />Latest checkpoint's NextXID:
         0/1810<br/>Latest checkpoint's NextOID:          13004<br /> Latest checkpoint's NextMultiXactId:  1<br
/>Latestcheckpoint's NextMultiOffset:  0<br />Latest checkpoint's oldestXID:        1800<br />Latest checkpoint's
oldestXID'sDB:   1<br />Latest checkpoint's oldestActiveXID:  0<br /> Latest checkpoint's oldestMultiXid:   1<br
/>Latestcheckpoint's oldestMulti's DB: 1<br />Maximum data alignment:               8<br />Database block size:
                 8192<br/>Blocks per segment of large relation: 131072<br /> WAL block size:
                      8192<br/>Bytes per WAL segment:                <a href="tel:16777216">16777216</a><br />Maximum
lengthof identifiers:        64<br />Maximum columns in an index:          32<br />Maximum size of a TOAST chunk:
       1996<br/> Size of a large-object chunk:         2048<br />Date/time type storage:               64-bit
integers<br/>Float4 argument passing:              by value<br />Float8 argument passing:              by value<br
/>Datapage checksum version:           0<br /><br /><br />Values to be changed:<br /><br />First log segment after
reset:       000000010000000000000002<br /><br />--<br />$ pg_resetxlog  -s0 data<br />Transaction log reset<br
/><span></span>$pg_controldata data | grep "Database system identifier"<br /> Database system identifier:
          6029284919152642525<br/><br />this patch dose not works fine with -s0.<br /><br />Regards,<br />--<br
/>SawadaMasahiko</span></font><br /><br />On Thursday, June 26, 2014, Petr Jelinek <<a
href="mailto:petr@2ndquadrant.com">petr@2ndquadrant.com</a>>wrote:<br /><blockquote class="gmail_quote"
style="margin:00 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 25/06/14 19:43, Sawada Masahiko wrote:<br
/><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Hi,<br /><br />
Isend you review comment about thie patch.<br /></blockquote><br /> Hello, thanks.<br /><br /><blockquote
class="gmail_quote"style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> --<br /> $ pg_resetxlog -s -n
 data| grep "Database system identifier"<br /> Database system identifier:           6028907917695471865<br /><br />
The-s option does not worksfine with -n option.<br /></blockquote><br /> Fixed.<br /><br /><blockquote
class="gmail_quote"style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> --<br /> $ pg_resetxlog<br />
-<u></u>s60289079176954718651111111111<u></u>111111111111111111111111111111<u></u>11111111111111<br/> data<br />
Transactionlog reset<br /> $ pg_controldata data | grep "Database system identifier"<br /> Database system identifier:
         18446744073709551615<br /><br /> pg_resetxlog is finished successfully, but system identifier was not<br />
changed.<br/> Also I think that checking data about number of digits is needed.<br /><br /></blockquote><br /> It
actuallydid change the identifier, just to ULONG_MAX, since that's the maximum value that can be set (scanf does that
conversion),I added check that limits the maximum value of system identifier input to ULONG_MAX-1 and reports error if
it'sbigger. I also added some additional input validation.<br /><br /> -- <br />  Petr Jelinek                  <a
href="http://www.2ndQuadrant.com/"target="_blank">http://www.2ndQuadrant.com/</a><br />  PostgreSQL Development, 24x7
Support,Training & Services<br /></blockquote><br /><br />-- <br />Regards,<br /><br />-------<br />Sawada
Masahiko<br/><br /> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Changes in amcanreturn() interface to support multicolumn indexes
Next
From: Tom Lane
Date:
Subject: Re: Allowing NOT IN to use ANTI joins