[Linux-ha-dev] LRM Testing (take 2)
alanr at unix.sh
Fri Jun 11 09:26:34 MDT 2004
> On Jun 11, 2004, at 4:06 PM, Alan Robertson wrote:
>> Jiang Dong Sun wrote:
>>> Ok, according to the popular opinion, will change the "uuid"'s format.
>>> Before that, please tolerate the inconvenience brought by UUID in LRM
>>> for a while. ;-)
>> I'm sorry I was off the list fixing hardware while all this went on...
>> The UUID format is the right answer... It is a standard, actually,
>> and we should just use it.
>> Don't mess with it.
>> However, it is NOT a string, and cannot be strcmp()ed... You can use
>> a string provided you NULL-pad the string in every case...
>> It is a binary value of 128 bits.
>> Making it of arbitrary length overly complicates the interface because
>> you now have to pass the length everywhere you use it - BECAUSE IT IS
>> BINARY, not a string.
> Two questions:
> Why is a UUID automatically the right type for a resource ID? I still
> dont see the benefit over a char*.
It is guaranteed unique. It is a standard used in lots of places,
including Linux filesystems
> Why does the LRM care what value we pass in as long as it hasn't been
> used before?
You need to know the semantics for comparision:
Do all bytes count?
Do only bytes up to a NULL count?
Does local character set issues matter?
You need to know the size
Have it be a fixed size (UUID)
Pass a size (arbitrary binary blob)
Have an implicit size (NUL-terminated 'C' string)
Have it be self-describing (Java string, C++ string, etc.)
And, dealing with a fixed size object is simply easier than packing a
variable length string. You can *encode* a UUID into a string. But, then
it's not a UUID, it's a string...
> And a bonus question since I havent used UUID generators of late:
> Do the UUID generators guarantee to produce UUIDs even if the program
> was stopped and restarted, or run as a part of different applications?
They will be unique - across reboots, across nodes in a cluster, across the
planet, across the universe, across all time and space. Perfect for Dr.
Who. Very powerful idea.
Alan Robertson <alanr at unix.sh>
"Openness is the foundation and preservative of friendship... Let me claim
from you at all times your undisguised opinions." - William Wilberforce
More information about the Linux-HA-Dev