unable to delete certain keys in a bucket

Hristo Asenov hristo.s.asenov at gmail.com
Mon Sep 29 15:47:32 EDT 2014


When I execute curl -vvv "http://10.100.2.1:8098/buckets/0/keys?keys=true",
I get


* Hostname was NOT found in DNS cache
*   Trying 10.100.2.1...
* Connected to 10.100.2.1 (10.100.2.1) port 8098 (#0)
> GET /buckets/0/keys?keys=true HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 10.100.2.1:8098
> Accept: */*
>
< HTTP/1.1 200 OK
< Vary: Accept-Encoding
* Server MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) is not
blacklisted
< Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
< Date: Mon, 29 Sep 2014 19:35:53 GMT
< Content-Type: application/json
< Content-Length: 3097
<
{"keys":["1408027632,637895","1411481227,295664","1411067577,760809","1411067577,820984","1408027562,409212","1408027617,634018","1411055693,671403","1411067527,820821","1408107754,23371","1411052324,367979","1410810751,490969","1408376949,515985","1408376769,337445","1410811439,545692","1411481162,809211","1411481212,828040","1411145662,434495","1411149788,520203","1411149791,649895","1408376599,7003","1410811519,767314","1408027572,416511","1411149762,551821","1411481167,284037","1411149758,502992","1411481192,823044","1408027582,421183","1411481227,303718","1408376939,506189","1411065848,107536","1411065848,88688","1411149761,605790","1411481237,299483","1408027592,426136","1411065839,955075","1408371511,84877","1410810696,454553","1411481222,828821","1408376578,991336","1410811449,549998","1411481217,296488","1411065819,951067","1407874581,121574","1408027602,623396","1408376919,486772","1410790655,103559","1411149781,611027","1410790625,74281","1411149771,608085","1411065817,894957","1408107769,35920","1411149768,516016","1408376849,416822","1411052384,587557","1411481192,832694","1411149791,638524","1408107764,221967","1408376759,327909","1407876563,538970","1408040348,899905","1411052394,594982","1411149792,560029","1408107774,222373","1411149791,694760","1411481197,286197","1411145672,444303","1410810721,467992","1408376639,213879","1408376799,367382","1411067567,828559","1411481232,823651","1408376959,526132","1408376789,357523","1411149798,520246","1408377009,573796","1410810651,235473","1411065789,959718","1408027662,666992","1411052374,795850","1411055703,681560","1411481202,829612","1411067537,545558","1411065868,113228","1410811479,752543","1408376859,426615","1408040328,505387","1408371500,893290","1411067607,771910","1408107794,222102","1411067547,548767","1408376909,476338","1410811529,771697","1408371531,99068","1410292959,855364","1408376659,229822","1410293020,86482","1410810681,258707","1411052369,797347","1410811539,776574","1411149791,620825","1408107834,222424","1411481157,362557","1408027702,706220","1408027692,696481","1408107864,222361","1411067582,767529","1411067587,758424","1411067617,767850","1408376969,534024","1408027652,657185","1411052354,573461","1411149798,594361","1408371516,93058","1411145702,645519","1410790594,873646","1410811499,757996","1411067587,769107","1408107824,222451","1408376819,387112","1408027602,633917","1411065827,904488","1408376839,406808","1411065827,896924","1408040338,514936","1411481182,817170","1410811459,554657","1410811509,762713","1408107784,40046","1410810741,481205","1408376869,436563","1411055682,445936","1408376669,239254","1408107814,222110","1411149752,550558","1408107804,222080","1408027612,629097","1410293130,194410","1411481146,505447","1411065799,954601","1408376979,544139","1411052414,614183","1411067607,780468","1411055693,680924","1408027672,676832","1410790665,113344","1411481157,273911","1411067592,769137","1411052354,641582","1411481212,822550","1411149788,526850","1411065829,960590","1411481207,294079","1408107764,29679","12,12","12","3*
Connection #0 to host 10.100.2.1 left intact
","2","30","9","5","18"]}%

Then if, for instance, I want to delete the first element, with curl -vvv
-XDELETE "http://10.100.2.1:8098/buckets/0/keys/1408027632,637895" I get

* Hostname was NOT found in DNS cache
*   Trying 10.100.2.1...
* Connected to 10.100.2.1 (10.100.2.1) port 8098 (#0)
> DELETE /buckets/0/keys/1408027632,637895 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 10.100.2.1:8098
> Accept: */*
>
< HTTP/1.1 404 Object Not Found
< X-Riak-Vclock:
a85hYGBgymDKBVIcypz/fgZVNbBnMCUy5rEyfHBPPMsHlWoS6mMJ4RPigkpFFHaf5csCAA==
< X-Riak-Deleted: true
* Server MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) is not
blacklisted
< Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
< Date: Mon, 29 Sep 2014 19:42:02 GMT
< Content-Type: text/plain
< Content-Length: 10
<
not found
* Connection #0 to host 10.100.2.1 left intact


Then when I execute curl -vvv -XDELETE "
http://10.100.2.1:8098/buckets/0/keys/1408027632,637895" the same thing
happens, I get a "not found" error. I am not sure, but this sort of data
corruption could be due to me using comma in the key, but if you notice
towards the end there are some keys such as 2, 30, 9 that have no commas
and they behave the same. Additionally, I tried inserting with the same key
and some junk data, and it worked. I was able to delete the data that is
associated with the key, but the actual key still remained.

On Mon, Sep 29, 2014 at 3:24 PM, Luke Bakken <lbakken at basho.com> wrote:

> Hi Hristo,
>
> Please see my comments and questions inline...
>
> > I am using riak version 1.4.10 and it is in a cluster with two hosts. I
> am
> > unable to get rid of keys left over from previous operations using simple
> > delete operations on keys.
>
> Could you please try and delete the keys using "curl -vvv -XDELETE
> http://...." and let us know the output? The "-vvv" argument will give
> us the HTTP response code and will show all headers.
>
> > When I list the keys for a bucket, it shows me
> > the old keys, however if I try to retrieve the data associated with a
> key,
> > no data is found.
>
> Could you also paste the output when you retrieve a "deleted" key via
> "curl -vvv -XGET http://...." ?
>
> > Is there a way to wipe the keys in the bucket so it starts from a clean
> > slate? I don't care about any of the data in riak, but I would rather not
> > have to reinstall everything again. What would happen If I just delete
> > everything from /var/lib in both hosts?
>
> Don't delete everything from /var/lib - you'll delete the ring and
> other important directories. Find the value of data_root for your data
> backends, and then delete the contents of that directory. For
> instance, /var/lib/riak/bitcask is the default data_root for bitcask,
> so to delete all the data you'd execute the following on all hosts:
>
> riak stop
> rm -rf /var/lib/riak/bitcask/*
> riak start
>
> > I also noticed that recently I did an update, and one of my clusters was
> > using leveldb as a backend and another was using bitcask. I updated the
> > configs so that both are using bitcask, but I am wondering if there is
> some
> > stale data left over. In one of the clusters in /var/lib there is still a
> > leveldb folder. Is it safe to delete it?
>
> Yes if you are sure the data is no longer needed.
>
> --
> Luke Bakken
> Engineer / CSE
> lbakken at basho.com
>



-- 
Hristo Asenov
260 Elkton Rd Apt. C-2
Newark, DE 19711
(732) 604 8349 (c)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140929/0a6ec439/attachment.html>


More information about the riak-users mailing list