couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Fair <mich...@daclubhouse.net>
Subject Re: Calculating Revision IDs outside erlang (proposal to add {minor_version, 1} to the calc)
Date Wed, 23 Mar 2016 05:12:52 GMT
On Tue, Mar 22, 2016 at 7:52 PM, Adam Kocoloski <kocolosk@apache.org> wrote:

> Wow, does this mean that a CouchDB server running R16 and another running
> R17 will compute different revision IDs for the same document?


That would definitely happen as that would be a minor_version, 1 vs 0.

I also believe it's possible even across the same erl releases <OTP 17.0 on
different architectures if there's a difference in float rounding
implementation; through I haven't actually seen it happen yet (so far all
my comparisons have been against >OTP 17.0).

If anyone running < OTP 17.0 tries:

io:format("~.20e~n",[3.14159]).
3.1415899999999999000e+0

or

io:format("~.20e~n",[3.1415]).
3.1415000000000002000e+0


and gets anything different than those two answers then it would happen
between this Couch and that machine as well.

Or to test in Couch directly here's:

{
   "_id": "pi",
   "pi": 3.14159
}
_rev: "1-fef08460e5939d65f40f93f75ffad893"

or

{
   "_id": "piSmall",
   "pi": 3.1415
}
_rev: "1-6fcc4c4758e81af8ffb5a7df5de39533"

I didn't pick those numbers especially for any reason it was just the first
and easiest float test doc that came to mind.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message