Hide Forgot
Description of problem: If image or bucket is missing in the filesystem back-end, an attempt to delete an image fails. So, if anything bad happens to back-end, the database cannot "heal". Version-Release number of selected component (if applicable): 0.95 How reproducible: Synchronous Steps to Reproduce: 1. Create a bucket and an image 2. delete image and bucket using Linux shell (imitate corruption) 3. Attempt to delete the image Actual results: Deletion fails with "500 Internal Error" Expected results: The image record should be deleted from the database. Additional info: Perhaps what we really need is some kind of automatic consistency checker. Not only disappearing images need to be recovered, but also images with bit errors. This must account for replication, too. For now though simple things ought to continue to work in case of consistency issues.
please recreate and paste build info
Doing a src install from iwhd git repo commit 9e86ebf939a68c37c04004e8248013aab8f8cbb9 shows that this is still a issue although ***sligthly different***. The delete through the API returns 404 and a subsequent get receives a 500. http://hudson.rhq.lab.eng.bos.redhat.com:8080/hudson/job/imageWarehouse/758/ http://hudson.rhq.lab.eng.bos.redhat.com:8080/hudson/job/imageWarehouse/758/testngreports Steps to reproduce 1. create a bucket, curl -X POST -d 'name=test_bucket_2' http://ip:port/_new 2. create a object in the bucket, curl -X PUT http://ip:port/test_bucket_2/camaro 3. rm -rf /var/lib/iwhd/<bucket>/<object>, rm -rf /var/lib/iwhd/test_bucket_2/camaro 4. try to delete object through the api, curl -X DELETE http://ip:port/test_bucket_2/camaro (receive 404 error) 5. http get on the object, curl -X GET http://ip:port/test_bucket_2/camaro (receive 500 error)
Gentlemen, I just wanted to have a bug so that I don't forget to fix it. It is trivially reproducible in iwhd-0.96.
Created attachment 514942 [details] proposed patch
I think there is still an issue here, issuing get on a key that was corrupted and then deleted through curl returns a 500, Internal Server Error. ================================== Test delete on corrupted key ================================== create bucket, rc: 201 create a key in the bucket, rc: 201 remove the key on fs, rc: 0 delete key w/ curl, rc: 404 get key w/ curl, expect rc404, rc: 500 cleanup bucket, rc: 404
Created attachment 517644 [details] shell script testing corruption
Oh it is there all right. Missed 0.98.
modified http://git.fedorahosted.org/git/?p=iwhd.git;a=commit;h=2df124f0bbe3d66c21d1fe58f446f73d7822f93e
making sure all the bugs are at the right version for future queries
Test passed with version 0.991. I will test it against 1.0 yet and create automatic test for regression testing. ================================== Test delete on corrupted bucket ================================== create bucket, rc: 201create a object in the bucket remove the object of th bucket on fs, rc: 0 delete the bucket w/ curl, rc: 200 get bucket w/ curl, expect rc404, rc: 404 ================================== Test delete on corrupted key ================================== create bucket, rc: 201 create a key in the bucket, rc: 201 remove the key on fs, rc: 0 delete key w/ curl, rc: 200 get key w/ curl, expect rc404, rc: 404 cleanup bucket, rc: 404
Successfully tested with 1.0 version too. Moving the bug to VERIFIED. # ./test.sh && iwhd --version ================================== Test delete on corrupted bucket ================================== create bucket, rc: 201 create an object in the bucket, rc: 201 remove the object of th bucket on fs, rc: 0 delete the bucket w/ curl, rc: 200 get bucket w/ curl, expect rc 404, rc: 404 ================================== Test delete on corrupted key ================================== create bucket, rc: 201 create a key in the bucket, rc: 201 remove the key on fs, rc: 0 delete key w/ curl, rc: 200 get key w/ curl, expect rc 404, rc: 404 cleanup bucket, rc: 404 iwhd (iwhd) 1.0.1-1945