where did my data go when I write to riak?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

where did my data go when I write to riak?

David Montgomery
Hi,

I am using latest ubuntu release for 64.

I am writing to riak and i get no errors.  Then again....given a key...,I also get no data.  Where did it go?  How does one debug riak when you write to riak..it looks like a success, get no data when get by key and get no errors.

To start, I wrote to riak using this bucket.  I am using the python api.

impression_bucket = client.bucket('impressions')
impression_bucket.set_n_val(2)
impression_bucket.set_dw(1)

worker_bucket = impression_bucket.new(id, data=qs)
print worker_bucket.store()

When I write I get thus object whic is my only idnication of success.  I even changed dw to 2.

<riak.riak_object.RiakObject object at 0x3027f10>


When I query the key....I get nothing.  So.....rather confused on how I can write and the data is now lost.........

Yes...the buckets are the same for a write and a read.  I print how the id as key and data as value and all valid entries.


I have data stored on an external device.  Data is stored in /data/riak and riak is total permissions.  In that dir I see these folders.  kv_vnode  lost+found  mr_queue.

Riak control looks 100% ok with all green lights

Only option I changed was {platform_data_dir, "/data/riak"}, in app.config.

Thanks








_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: where did my data go when I write to riak?

bryan-basho
Administrator
On Wed, Dec 19, 2012 at 2:50 AM, David Montgomery
<[hidden email]> wrote:
> I am writing to riak and i get no errors.  Then again....given a key...,I
> also get no data.  Where did it go?  How does one debug riak when you write
> to riak..it looks like a success, get no data when get by key and get no
> errors.

Hi, David. I interpolated around your description, and saw this behavior:

>>> from riak import RiakClient
>>> client = RiakClient()
>>> impression_bucket = client.bucket('impressions')
>>> impression_bucket.set_n_val(2)
>>> impression_bucket.set_dw(1)
<riak.bucket.RiakBucket object at 0x1013fa850>
>>> id = "foo"
>>> qs = "bar=baz"
>>> worker_bucket = impression_bucket.new(id, data=qs)
>>> print worker_bucket.store()
<riak.riak_object.RiakObject object at 0x1004acb50>
>>> impression_bucket.get(id)
<riak.riak_object.RiakObject object at 0x1004acd50>

That answer looked like something was cheating to me, so I also
restarted the node, and tried again:

>>> impression_bucket.get(id)
<riak.riak_object.RiakObject object at 0x1013fa8d0>
>>> o1 = impression_bucket.get(id)
>>> o1.get_data()
u'bar=baz'

That looks like things are working on my setup. Could you let me know
whether this is exactly what you did, or at which step we diverged, so
I can check with your exact process?

> I have data stored on an external device.  Data is stored in /data/riak and
> riak is total permissions.  In that dir I see these folders.  kv_vnode
> lost+found  mr_queue.
>
> Only option I changed was {platform_data_dir, "/data/riak"}, in app.config.

I agree that this does look suspicious, but it's actually normal. The
`platform_data_dir` setting controls where generic vnode operational
data is stored. The setting controlling where your application's data
is stored is controlled by the `data_root` setting in the `bitcask` or
`eleveldb` section of app.config, depending on which backend you're
using.

Hope that helps,
Bryan

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Loading...