Git Product home page Git Product logo

riak-cpp's People

Contributors

ajtack avatar deanoc avatar mcobzarenco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

deanoc yodamaster

riak-cpp's Issues

Add Tests that employ Lambdas

At the time of this writing, Riak-cpp relies entirely on traditional functions (with std::bind, for instance) to react to various operations. This is due to the original goal of first-class g++ v4.4 support. However, we need to explicitly target these new technologies.

Acceptance Criteria

  • Every riak operation has a passing test employing a lambda instead of std::bind.
  • All tests employing lambdas are guarded (#ifndef) for a compatible compiler (>= g++-4.4)
  • The documentation is updated to prefer lambda syntax.

Tests fail with double free under GCC v4.6+

Failure as per the below stacktrace.

(gdb) r
Starting program: /Users/tack/Desktop/riak-cpp/build/test/units/unit_tests 
Reading symbols for shared libraries ++++++++........................... done
[==========] Running 22 tests from 4 test cases.
[----------] Global test environment set-up.
[----------] 5 tests from deleting_client
[ RUN      ] deleting_client.client_survives_nonsense_reply_to_unmap
unit_tests(5110) malloc: *** error for object 0x1005e3560: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT, Aborted.
0x00007fff90ebd82a in __kill ()
(gdb) bt
#0  0x00007fff90ebd82a in __kill ()
#1  0x00007fff99443a9c in abort ()
#2  0x00007fff994a284c in free ()
#3  0x00007fff98340702 in std::string::_Rep::_M_dispose ()
#4  0x00007fff98341424 in std::string::reserve ()
#5  0x00007fff9834151d in std::string::append ()
#6  0x000000010036f4f5 in google::protobuf::MessageLite::AppendPartialToString ()
#7  0x000000010036f46a in google::protobuf::MessageLite::AppendToString ()
#8  0x000000010036f58b in google::protobuf::MessageLite::SerializeToString ()
#9  0x000000010005bafb in riak::message::(anonymous namespace)::package_with_code<RpbDelReq> ()
#10 0x000000010005b6dc in riak::message::encode<RpbDelReq> ()
#11 0x000000010004bdc5 in riak::client::delete_object ()
#12 0x00000001000010f7 in riak::test::deleting_client_client_survives_nonsense_reply_to_unmap_Test::TestBody ()
#13 0x00000001004eccf6 in testing::Test::Run ()
#14 0x00000001004ed5e3 in testing::internal::TestInfoImpl::Run ()
#15 0x00000001004edc5f in testing::TestCase::Run ()
#16 0x00000001004f22a5 in testing::internal::UnitTestImpl::RunAllTests ()
#17 0x00000001000192a8 in main ()

"Last-minute" responses must not race with timeouts callbacks.

Unless we set a very high timeout (e.g., 50 seconds), we're hitting this assertion:

riak/request_with_timeout.cxx:44: void riak::request_with_timeout::on_response(std::error_code, size_t, const std::string&): Assertion `not succeeded_ and (!! terminate_request_)' failed.

Is there something we might be doing wrong, or is that a bug in riak-cpp?

Implement a CMake Build System and Evaluate

SCons has served its purpose of getting this project off the ground. One of the things that has been a problem for me in the past is poor compatibility between versions of SCons; I've already had that problem once in this project.

CMake seems to have some traction in cross-platform building. We should try it out, see if it suits the project.

VS2010 build. error C2220: warning treated as error - no 'object' file generated

I am getting this error when I try to build the sources: error C2220: warning treated as error - no 'object' file generated

What am I doing wrong?

1>------ Build started: Project: riak-cpp, Configuration: Debug x64 ------
1>Build started 06/03/2013 19:41:28.
1>InitializeBuildStatus:
1> Touching "x64\Debug\riak-cpp.unsuccessfulbuild".
1>CustomBuild:
1> All outputs are up-to-date.
1>ClCompile:
1> client.cxx
1> message.cxx
1> request_with_timeout.cxx
1> riakclient.pb.cc
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2227): error C2220: warning treated as error - no 'object' file generated

I am using the newest sources from https://github.com/ajtack/riak-cpp.git

Support streaming PUT responses.

Currently, if a PUT response were to arrive in multiple chunks from the riak::transport device, the response would be rejected. We should use riak::message::make_buffering_handler to correctly buffer such responses until a complete message is received.

Definition of Done: A passing unit test shows that PUT responses behave in a way matching GET and DELETE responses: that a response message arriving in multiple parts is correctly combined and returned to the caller.

Building with DEBUG=no must disable assertions

Discovered while fixing #26: The intention of the DEBUG=no builds was, in addition to the enabling of stacktrace-mangling optimization, that assertions would be disabled. This apparently doesn't work as of v0.2, and it needs to be addressed.

Implement a stable client ID in riak::store

With the current connection pooling interface, each new connection will result in a new client ID. This will cause rapid key explosion. Definition of Done:

  • Implement a method to provide a stable client ID to each individual riak::store object.
  • Implement a test (manual is fine) to demonstrate that multiple PUT requests across multiple connections from a single riak store contain the client ID provided by the user.

Produce binary downloads for Riak-Cpp v1.0

Compiling on different platforms is going to be a never-ending problem. For those that want to use Riak-Cpp, we need to produce binary installations for them.

Target the following platforms:

  • Ubuntu (32- and 64-bit)
  • Debian (32- and 64-bit)
  • Mac OS
  • Windows

Cancellable Operations

Currently, a get/put/delete operation must be waited upon at the client.hxx level. It so happens it may be easy to shut down networking and thus trigger a rapid flood of socket cancellation errors, but this seems a bit roundabout.

It may be valuable to be able to cancel an operation at the client.hxx interface level. This also gets back into synchronous programming against Riak-Cpp, though, which I'm inclined to discourage.

This idea is in the "Do we need it?" question phase.

Introduce GCC v4.7 compatibility

GCC v4.7 introduces the noexcept term and employs it in <system_error>, which causes a compilation failure. Correct the code such that error.cxx compiles under all GCC compilers uniformly.

Collect statistics, reported passively via an API.

Riak-Cpp should expose mean/min/max for various time periods of such values as:

  • Average number of siblings encountered on get
  • Number of sibling resolutions required for each successful get operation
  • Numbers, separately, of
    • get requests
    • "update" puts, or those automatically generated by sibling resolution
    • "resolve siblings" puts, or those needed by the application directly
    • delete requests
  • Round-trip request latency, overall
  • Round-trip request latency per individual request types (not composite operations like get+sibling resolves)
  • Number of simultaneous in-flight (application-layer) requests

Add support for connection pooling (assuming boost::asio sockets)

Before this can reasonably be used by performant server software, connection pooling is a must. To satisfy this issue, the library must support:

  • Opaque request queueing (user doesn't know when requests are actually transmitted)
  • Protection against delayed responses (connections must be reset between uses)
  • Thread-safe usage of at least one connection (many is optional)
  • A custom implementation of the above as a subclass of the riak::connection_pool interface.

A complete implementation will also provide a default connection pool implementation, which will include test plans.

The following are optional:

  • Assumption of boost::asio sockets as the "connection" representative. Obviating this assumption will be a task for a subsequent milestone.
  • Multiple connections (in the default implementation.)

VS2010 the projet file ' ' has been renamed or is no longer in the solution

I grabed the sources and got the error message
"the projet file ' ' has been renamed or is no longer in the solution"
in Visual Studio 2010 when I tried to build.

Update: I might have messed up my VS2010 installation. I get some wired errors like "\Git\bin";"D:\Program was unexpected at this time." Need to check my environment.

Eliminate Squashing PUT operations

Due to my misinterpretation of the client implementation guide, Riak-Cpp currently allows a user to replace any number of siblings blindly with a new value. The correct behavior as described by Russell Brown:

"Clients (that automatically fetch before store) must chose to either
a) perform automatic Sibling Resolution or
b) abort the write and notify the presence of siblings to the caller."

Identify the next critical Riak Operations to implement

Riak-Cpp v0.1 only supports get, put, and delete. It does all things sibling resolution and a few other goodies as well, but fundamentally this is only the basic CRUD operations. Riak (the server), meanwhile, provides many searching, indexing and status-gathering features. Implementations of these features will require prioritization by an actual user of Riak-Cpp.

Produce an ordered list of implementation priorities from either the PBC API (preferred) or the HTTP API.

Implement puts not preceded by a get on the same object.

Currently, one has to PUT in the following sequence.

auto o = store(...).bucket("docs")["test"];
auto result = o.fetch();
result.wait();

// now o has the vector clock cached.
o.put("new value");

Unless we want to force users to ALWAYS consider siblings (which seems like too much overhead), one should be able to execute the last line and have riak automatically get the latest vector clock and push against it. Siblings will happen either way, actually.

Logging of Riak-Cpp behavior

Currently, the Riak client does not log at all. It hasn't been a problem yet, but logs are invaluable in the debugging of larger systems.

Implement logging in the form of hooks that are implemented by default, but that can be disabled or wired elsewhere.

Choose a Software License

In the current state (unlicenced), the code has an implicit copyright. This means I can withdraw this code from the public and prevent y'all from using it at a whim. I don't think this is fair. Rather, the license I want for this:

  • Allows linking with proprietary projects
  • Allows linking with non-insane open-source licenses (compatibility with GPL is not a deal-breaker)
  • Encourages (but does not require) modifications to be submitted back to the primary source: I want help.
  • Prevents others from rebranding the project under their name.
  • Prevents me from withdrawing this work from the public at a whim.

I would love suggestions. I'm considering the New BSD licence.

v1

At v1.0, Riak-Cpp has everything it needs to solve some subset of people's C++/Riak problems. Our target audience is high-performance server programmers using Riak as a backend.

Definition of Done:

  1. First production system using Riak-Cpp has been built and deployed.
  2. Missing features that make the library useful for our target customers have been added.
  3. Enabling documentation accompanies the tested (obviously) library.

Note that, for (2), we refer not to those features that were missing from 0.x implementations due to oversight, but rather those features that weren't considered for inclusion because those requirements had not been expressed. The former belongs in a 0.x release, and the set of those things may be empty.

Read/Write abortion on "Unresolvable Siblings" error

"If debugging is the process of removing bugs, then programming must be the process of putting them in."

Currently, failure to resolve siblings (by throwing an exception, for instance) will cause undefined behavior and leaking. Users need to be able to abort a read or write if they encounter a sibling set that they cannot resolve. Their server can then report an error that allows them to resolve the case.

Suggest:

  1. A new error code riak::errc::unresolvable_siblings to report as the reason for the failed read/write to the application.
  2. An exception type (maybe riak::unresolvable_siblings? Check how to interact with system_error.) that sibling resolution routines can throw when they get into trouble.

Include an advanced connection pool by default

Currently, we only provide the single serial socket transport by default. This is fine while we're getting off the ground, but it ain't ideal. An improved connection pooling alternative should:

  • Support multiple requests executing concurrently
  • Include a load test to demonstrate improvement over single-serial-socket.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.