On Tue, Jan 31, 2012 at 7:44 AM, francisco treacy <
francisco.tre...@gmail.com> wrote:
>
>
> db.get('user_books', 'maya012-8542')
> => { }
>

I'm assuming this does not represent an empty object


>
> It's found, k/v works at least.
>
> db.addSearch('user_books', 'bookId:8542 AND userId:maya012').reduce({
> language: 'erlang', module: 'riak_kv_mapreduce', function:
> 'reduce_identity' }).run(function(err,d) { console.log(d.length) })
> => 0
>
> Uh oh, nothing there. Let's see what we have:
>
> db.addSearch('user_books', 'userId:maya0121').reduce({ language:
> 'erlang', module: 'riak_kv_mapreduce', function: 'reduce_identity'
> }).run(function(err,d) { console.log(d) })
> => [ [ 'user_books', 'maya012-8528' ] ]
>

What about when you run a query on just userId?


>
> Aha. User is supposed to have 2 books but has one. Let's see if
> there's a disparity between counts in K/V and search:
>
> db.add('user_books').map('query', 'where
> .bookId:val("8542")').run(function(err, d) { console.log(d.length) })
> => 660
>
> db.addSearch('user_books', 'bookId:8542').reduce({ language: 'erlang',
> module: 'riak_kv_mapreduce', function: 'reduce_identity'
> }).run(function(err,d) { console.log(d.length) })
> => 660
>
> WTH? It seems that 'userId' is introducing some weirdness here.
>

If Search is missing replicas then results will become non-deterministic
and sometimes you will see correct results and other times you won't.  If
you run this query many times back-to-back and see different results then
you are losing data somewhere.


>
> I fetched/saved the document, and now things are back to normal...
>
> db.addSearch('user_books', 'bookId:8542 AND userId:maya012').reduce({
> language: 'erlang', module: 'riak_kv_mapreduce', function:
> 'reduce_identity' }).run(function(err,d) { console.log(d.length) })
> => 1
>

What happens if you rerun the bookId query and search?  Do they both still
return 660 or is it now 661?  Next time you run into this I'd like to see
the results of _all_ the queries before and after.  Also, run the search
query many times back-to-back and verify the answer is always the same.



>
> ...for maya012.  Go figure how many other users are getting incorrect
> data. Oh yea, I need to write another script to check them one by one.
>
> I waded through the logs, because there are tons of errors regarding
> Luwak... (oh right, that too! Probably 5% of the files return 0 bytes,
> awesome – but I digress) ... and can't find anything that is even
> close to be search-related.
>

Considering you seem to have both Search and Luwak data disappearing I'm a
bit concerned that it's not just coincidence.  What type of hardware are
you running on?  What's your network like between these machines?  What
does your app.config look like (and is it the same across the cluster)?
 What does your Search schema look like for user_books?  What does
`riak-admin status` show you?  What about `riak-admin ringready` and
`riak-admin transfers`?  While we are at it `riak-admin cluster_info
/tmp/cluster_info.txt` couldn't hurt to try as well.
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to