Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix issue with reloading deleted objects over PBC. #238

Merged
merged 1 commit into from

3 participants

@seancribbs
  • Reinstated @shuhaowu's obj.reload() in bucket delete test.
  • Set obj.exists to False if there are no contents, resolving reload problem.
@seancribbs seancribbs Fix issue with reloading deleted objects over PBC.
* Reinstated @shuhaowu's obj.reload() in bucket delete test.
* Set obj.exists to False if there are no contents, resolving reload
  problem.
ee54fd4
@seancribbs seancribbs was assigned
@shuhaowu

Is this just a work around? I'm not sure what the status returned by PBC is in the case where contents = []

Perhaps we should use clear. That's extra work, however. The alternative is we could declare that if an object retrieved has .exists to be False, the object is invalid.

@seancribbs

When contents are empty, the significance is "not found".

@seancribbs

Your point is well taken, however. This is just a band-aid for more rigorous handling of siblings, which I am working on in another branch.

@javajolt
Collaborator

Fix checks out. :+1: to merge!

@javajolt javajolt was assigned
@seancribbs seancribbs merged commit f6c6e9b into master

1 check failed

Details default The Travis build failed
@seancribbs seancribbs deleted the sdc-fix-pbc-deleted branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 5, 2013
  1. @seancribbs

    Fix issue with reloading deleted objects over PBC.

    seancribbs authored
    * Reinstated @shuhaowu's obj.reload() in bucket delete test.
    * Set obj.exists to False if there are no contents, resolving reload
      problem.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +1 −1  riak/tests/test_kv.py
  2. +1 −0  riak/transports/pbc/transport.py
View
2  riak/tests/test_kv.py
@@ -206,7 +206,7 @@ def test_bucket_delete(self):
obj.store()
bucket.delete(self.key_name)
- obj = bucket.get(self.key_name)
+ obj.reload()
self.assertFalse(obj.exists)
def test_set_bucket_properties(self):
View
1  riak/transports/pbc/transport.py
@@ -127,6 +127,7 @@ def _decoded_contents(self, resp, old_obj):
ret.siblings = contents[:]
return ret
else:
+ old_obj.exists = False
return old_obj
def get(self, robj, r=None, pr=None, vtag=None):
Something went wrong with that request. Please try again.