basho/riak-python-client — pull request #344 by seancribbs (2014-07-28 17:52:26+00:00)
Title: Consider managing context more aggressively

````python
>>> myset.store()

>>> myset.discard('fritz')
>>> myset.store()
Traceback (most recent call last):
File "", line 1, in
File "riak/datatypes/datatype.py", line 136, in update
self.bucket._client.update_datatype(self, **params)
File "riak/client/operations.py", line 748, in update_datatype
include_context=include_context)
File "riak/transports/pbc/transport.py", line 697, in update_datatype
MSG_CODE_DT_UPDATE_RESP)
File "riak/transports/pbc/connection.py", line 43, in _request
return self._recv_msg(expect)
File "riak/transports/pbc/connection.py", line 55, in _recv_msg
raise RiakError(err.errmsg)
riak.RiakError: '{precondition,{not_present,<<"fritz">>}}'
````

However, if I add a `myset.reload()` invocation before `store()`, things work as expected.

So, I'd wager that the vector clock isn't being pulled into the object as part of the `store` operation. I think this behavior will be unexpected, although I'll admit that forcing developers to do `reload` before storing objects may make sense in a highly concurrent environment.