apple / foundationdb

FoundationDB - the open source, distributed, transactional key-value store
https://apple.github.io/foundationdb/
Apache License 2.0
14.53k stars 1.31k forks source link

Documentation for atomic max and min do not define endienness #2516

Open mpilman opened 4 years ago

mpilman commented 4 years ago

The documentation for FDB_MUTATION_TYPE_MAX says:

.. |atomic-max1| replace::
    Sets the value in the database to the larger of the existing value and ``param``. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of 
``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the 
existing value is truncated to match the length of ``param``.

This is, however, not clear as it doesn't define whether it interpret the unsigned integer as little or big endian. I would make a PR to change this but I actually am not sure which one of the two it is :)

ajbeamon commented 4 years ago

It seems the documentation for this in some places already includes a note about it being little-endian comparison. I guess that change wasn't made completely, though.

ajbeamon commented 4 years ago

See for example https://github.com/apple/foundationdb/blob/b193e3b9d086455e68e0f4ec5d571761fb909f57/fdbclient/vexillographer/fdb.options#L301

mpilman commented 4 years ago

Ah I see - ok, I will make this change in the docs when I have some time. Do you think it would make sense to have two atomic ops for this? One for big endian and one for little endian? Java-folks probably would prefer big endian...

atn34 commented 4 years ago

CC #2070