Page 1 of 1
New UUID generated
PostPosted:Mon Jan 09, 2017 10:36 am
by openkm_user
Hi,
How does new UUID generate? I know it is unique but is it always "new" or can the new one be one of UUID file that is deleted?
Like, consider file1 with UUID 1234, user deletes file1 and uploads another file file2, any chance this file2's UUID becoming the deleted file1's (1234)?
Thanks!
Re: New UUID generated
PostPosted:Tue Jan 10, 2017 9:45 am
by jllort
There'r are two distinct UUID, there's a unique UUID for the document, and then there's an specific UUID for the document version ( which is not the same of the UUID used to identify the document )
When you retrieve a document, you use the UUID + version name. Internally is converted to UUID version name, which is used to store the document in the datastore. Really from you side, you should be only interested in this combination UUID + version name or UUID ( what means the last version of the document )
Hope this give some light to you.
Re: New UUID generated
PostPosted:Thu Jan 19, 2017 3:29 pm
by openkm_user
I am not sure I am explaining this properly. My only concern is, if a document containing a UUID 1234-5678-9012-3456 is deleted (also deleted from Trash) and in future a document is uploaded, will this new document by any chance have the deleted document's UUID 1234-5678-9012-3456?
Re: New UUID generated
PostPosted:Fri Jan 20, 2017 7:23 pm
by jllort
It's quite difficult a new node in the database have the same UUID. The uuid generator is based in random numbers, but also with day time etc... It has a very very very small probability it happens a collision ( really the case should be create two documents practically at the same time, and I'm talking about miliseconds and another factors what makes it practically impossible ). I do not want to write the word "impossible" because in IT is quite dangerous, but I think is more probably you win in lottery all the days during a week rather than you see it.
Re: New UUID generated
PostPosted:Mon Jan 23, 2017 8:05 am
by openkm_user
Thanks again

. Since it depends on date, time, etc., probability of a new document getting UUID of another document is very low, like you explained. This solves another potential future bug

.