basho-labs / riak-c-client

Riak C Client
Apache License 2.0
20 stars 8 forks source link

Tweak the async and Build Configuration #53

Closed hazen closed 10 years ago

hazen commented 10 years ago
bookshelfdave commented 10 years ago

I'm trying to test this change, but riak_c_example doesn't pickup get/put. This appears to be a problem on develop as well:

R16B02b4:[develop]prime:~/basho/riak-c-client$ ./riak_c_example --put --host localhost --port 8087 --bucket "Foo" --key "Bar" --value "Baz"
option -h with value `localhost'
option -p with value `8087'
option -b with value `Foo'
option -k with value `Bar'
option -v with value `Baz'
R16B02b4:[develop]prime:~/basho/riak-c-client$ ./riak_c_example --get --host localhost --port 8087 --bucket "Foo" --key "Bar" --value "Baz"
option -h with value `localhost'
option -p with value `8087'
option -b with value `Foo'
option -k with value `Bar'
option -v with value `Baz'
bookshelfdave commented 10 years ago

ok, I started a different Riak node from a devrel w/out TLS enabled ;-) However, the example fails silently if you specify an invalid port #:

./riak_c_example --get --host localhost --port 1234 --bucket "Foo" --key "Bar"
option -h with value `localhost'
option -p with value `1234'
option -b with value `Foo'
option -k with value `Bar'

R16B02b4:[refactor/bch/tweak-async *]prime:~/basho/riak-c-client$ ./riak_c_example --put --host localhost --port 10017 --bucket "Foo" --key "Bar" --value "Baz"
option -h with value `localhost'
option -p with value `10017'
option -b with value `Foo'
option -k with value `Bar'
option -v with value `Baz'
V-Clock: 6bce61606060cc60ca05521c47833672070b4ccace604a64cc6365e8e36b3dc3970500
Objects: 1
Bucket:
Value:
Last Mod: 2014-02-28 08:43:42
Last Mod uSecs: 453013
VTag: 3QDLNpWQteoTaPsPTeV4Oa

R16B02b4:[refactor/bch/tweak-async *]prime:~/basho/riak-c-client$ ./riak_c_example --get --host localhost --port 10017 --bucket "Foo" --key "Bar"
option -h with value `localhost'
option -p with value `10017'
option -b with value `Foo'
option -k with value `Bar'
Bucket: Foo
Key: Bar
Value: Baz
Last Mod: 2014-02-28 08:43:42
Last Mod uSecs: 453013
VTag: 3QDLNpWQteoTaPsPTeV4Oa

Passing in --async prints out Inserted events, but that's about it.

R16B02b4:[refactor/bch/tweak-async]prime:~/basho/riak-c-client$ ./riak_c_example --put --async --host localhost --port 10017 --bucket "Foo" --key "Bar" --value "Baz"
option -h with value `localhost'
option -p with value `10017'
option -b with value `Foo'
option -k with value `Bar'
option -v with value `Baz'
Inserted events:
  0x7ff093c084c8 [fd 5] Read Persist
  0x7ff093c095e0 [fd 7] Read Persist
R16B02b4:[refactor/bch/tweak-async]prime:~/basho/riak-c-client$ ./riak_c_example --get --async --host localhost --port 10017 --bucket "Foo" --key "Bar" --value "Baz"
option -h with value `localhost'
option -p with value `10017'
option -b with value `Foo'
option -k with value `Bar'
option -v with value `Baz'
Inserted events:
  0x7fb4634084c8 [fd 5] Read Persist
  0x7fb4634095e0 [fd 7] Read Persist
bookshelfdave commented 10 years ago

Verified riak_async.h is copied into /usr/local/include upon sudo make install.

hazen commented 10 years ago

Did you look in your riak.log for output from riak_c_example?

Oculus:~/dev/clients/c/riak-c-client> ./riak_c_example --get --bucket x --key y
option -b with value `x'
option -k with value `y'
Oculus:~/dev/clients/c/riak-c-client> cat riak.log
2014-02-28 08:55:52 PST CRIT Could not connect a socket to host 127.0.0.1:10017 [Connection refused]

2014-02-28 08:55:52 PST CRIT Could not just open a socket
bookshelfdave commented 10 years ago

ah, ok. I see a "connection refused" in riak.log. Can CRIT error be displayed as well as logged?

also, another observation:

Performing a get on a key that doesn't exist returns... "C stuff":

R16B02b3:[refactor/bch/tweak-async]localhost:~/basho/riak-c-client$ ./riak_c_example --get --bucket x --key foobar
option -b with value `x'
option -k with value `foobar'
P�[\�
bookshelfdave commented 10 years ago

A not found will return an empty pbgetresp, should we check to see if n_content == 0? https://github.com/basho/riak-c-client/blob/develop/src/messages/riak_get.c#L127

bookshelfdave commented 10 years ago
./riak_c_example --get --bucket x --key foobar
option -b with value `x'
option -k with value `foobar'
�˖Q�
hazen commented 10 years ago

You rebuilt on this branch, right? A fresh pull of this branch gets me:

./riak_c_example --get --bucket x --key foobar
option -b with value `x'
option -k with value `foobar'
V-Clock:
Unmodified: false
Deleted: false
Objects: 0
bookshelfdave commented 10 years ago

re-cloned the branch, rebuilt:

./riak_c_example --get --bucket x --key foobar
option -b with value `x'
option -k with value `foobar'
V-Clock:
Unmodified: false
Deleted: false
Objects: 0

+1, merge away

bookshelfdave commented 10 years ago

we need to address GET "not found"s

hazen commented 10 years ago

Going with your "looks good" comment from HipChat to merge