-
Notifications
You must be signed in to change notification settings - Fork 35
Unique system ids for cached initdb #35
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unique system ids for cached initdb #35
Conversation
Codecov Report
@@ Coverage Diff @@
## master #35 +/- ##
==========================================
- Coverage 97.17% 97.17% -0.01%
==========================================
Files 13 13
Lines 1167 1202 +35
==========================================
+ Hits 1134 1168 +34
- Misses 33 34 +1
Continue to review full report at Codecov.
|
I've modified shardman to use this stuff and it works great, thanks. |
system_id |= (os.getpid() & 0xFFF) | ||
|
||
# pack ULL in native byte order | ||
return struct.pack('=Q', system_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably bail out with struct.error: argument out of range
after 19 January 2038, but for now it is fine :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arssher Why? We have 32 bits for seconds, and that's ~136 years.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, =Q is unsigned. Yes, then we have 68 years more.
If enabled, generate unique system ids for nodes spawned from initdb cache.