- Notifications
You must be signed in to change notification settings - Fork5
Commit5035701
committed
Improve generation algorithm for database system identifier.
As noted some time ago, the original coding had a typo ("|" for "^")that made the result less unique than intended. Even the intendedbehavior is obsolete since it was based on wanting to produce ausable value even if we didn't have int64 arithmetic --- a limitationwe stopped supporting years ago. Instead, let's redefine the systemidentifier as tv_sec in the upper 32 bits (same as before), tv_usecin the next 20 bits, and the low 12 bits of getpid() in the remainingbits. This is still hardly guaranteed-universally-unique, but it'snoticeably better than before. Per my proposal at<29019.1374535940@sss.pgh.pa.us>1 parent528c454 commit5035701
1 file changed
+7
-6
lines changedLines changed: 7 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4889 | 4889 |
| |
4890 | 4890 |
| |
4891 | 4891 |
| |
4892 |
| - | |
4893 |
| - | |
4894 |
| - | |
4895 |
| - | |
4896 |
| - | |
| 4892 | + | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
4897 | 4897 |
| |
4898 | 4898 |
| |
4899 | 4899 |
| |
4900 |
| - | |
| 4900 | + | |
| 4901 | + | |
4901 | 4902 |
| |
4902 | 4903 |
| |
4903 | 4904 |
| |
|
0 commit comments
Comments
(0)