You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/01/25 06:54:59 UTC

[GitHub] [couchdb] valpa opened a new issue #2490: Feature request: add utc_random in _rev field

valpa opened a new issue #2490: Feature request: add utc_random in _rev field
URL: https://github.com/apache/couchdb/issues/2490
 
 
   For document creation, we are using utc_random configuration to know the creation time from id field. We also have a need to get track about document update time. If the rev filed can use utc_random similar to id field, we can use the rev field to know what time it gets updated.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] nickva closed issue #2490: Feature request: add utc_random in _rev field

Posted by GitBox <gi...@apache.org>.
nickva closed issue #2490: Feature request: add utc_random in _rev field
URL: https://github.com/apache/couchdb/issues/2490
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] nickva commented on issue #2490: Feature request: add utc_random in _rev field

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #2490: Feature request: add utc_random in _rev field
URL: https://github.com/apache/couchdb/issues/2490#issuecomment-584209608
 
 
   Hi @valpa sorry for delayed response.
   
   In CouchDB the revs are generated based on parent revisions. That helps for example when the same document is created and edited in the same way on two different servers and then those dbs get replicated together, because revisions are deterministic based on content and parent revision, no conflicts should be generated. If revisions are completely random the would be conflicts.
   
   Here is the place where it happens: 
   
   https://github.com/apache/couchdb/blob/master/src/couch/src/couch_db.erl#L1125-L1140
   
   Having a random uuid generated there would result in a proliferation of document conflicts.
   
   It might also be easier to just add a timestamp to your document and simply inspect that timestamp value later.
   
   Have, having said that, now you also know of a good place to experiment :-). So give it a try and see what would happen if you replace it a uuid1 generated value there.
   
   But I think I'll close the issue, as I don't think there is much of a chance to change the CouchDB behavior there. If you think it deserves a proper discussion for others to chime in, start a mailing list discussion.
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services