Forum: Building VoltDB Applications

Post: K-Safety Question

K-Safety Question
will
Jul 12, 2010
I have setup a small cluster of 2 Debian machines in order to test out VoltDB's K-Safety feature for potential deployment. I'm testing it using the voter example with a total of 4 partitions across both machines and a K-Safety value of 1. Whenever I simulate a system crash by stopping one of the machines server the entire Volt system stops executing the client script, but the server on the other machine remains online. Is this normal behavior? If so, is there a way to ensure that the database processes from the client will continue to be executed even if one server goes offline?

Here are the relevant parts of the logs:

S
erver (the one that remains up):


[java] 12 [main] INFO HOST - Build: 1.0.01 https://svn.voltdb.com/eng/trunk?revision=640
     [java] 30 [main] INFO HOST - HTTP admin console listening on port 8080
      [java] 30 [main] INFO HOST - Loading application catalog jarfile from  /home/xenide/Desktop/Volt/examples/voter/catalog/catalog.jar
     [java] 101 [main] INFO HOST - Creating host manager for 2 hosts using leader /192.168.1.59
     [java] 107 [Thread-3] INFO HOST - Connecting to VoltDB cluster as the leader...
     [java] 27850 [Thread-3] INFO HOST - Maximum clock/network skew is 6 milliseconds (according to leader)
      [java] 32874 [Site 4] INFO HOST - Attempting to load native VoltDB  library voltdb-1.0.01. Expect to see a confirmation following this upon  success. If none appears then you may need to compile VoltDB for your  platform or you may be running a 32-bit JVM.
     [java] 32875 [Site 4] INFO HOST - Successfully loaded native VoltDB library voltdb-1.0.01.
     [java] Creating Execution Engine on clusterIndex=1, site_id = 2...
     [java] Creating Execution Engine on clusterIndex=1, site_id = 1...
     [java] Creating Execution Engine on clusterIndex=1, site_id = 3...
     [java] Creating Execution Engine on clusterIndex=1, site_id = 4...
     [java] INITIALIZING INITIATOR ID: 1, SITEID: 0
     [java] 33047 [main] INFO HOST - Internal profiling is disabled on multi-partition hosts.
     [java] 33063 [main] INFO HOST - Starting the network
     [java] 33164 [main] INFO HOST - --------------------------------
     [java] Server completed initialization.
     [java] 
     [java] 89859 [Volt Network] ERROR HOST - Host failed, hostname: laptop
     [java] 89859 [Volt Network] ERROR HOST -   Host ID: 1
     [java] 89859 [Volt Network] ERROR HOST -   Removing sites from cluster: [100, 101, 102, 103, 104]


Client:
 [java] Allowing 2 votes per phone number
     [java] Submitting 100,000 SP Calls/sec
     [java] Feedback interval = 5 second(s)
     [java] Running for 120 second(s)
     [java] Latency not recorded for 3 second(s)
      [java] No logging configuration supplied via -Dlog4j.configuration.  Supplying default config that logs to INFO or higher to STDOUT
     [java] Connecting to server: '192.168.1.59'
     [java] Connecting to server: '192.168.1.50'
     [java] Running for 6 contestant(s)
      [java] 4.179% Complete | SP Calls: 84,601 at 16,869.59 SP/sec |  outstanding = 39437 (39437) | min = 1545 | max = 3596 | avg = 2777.37
      [java] 8.420% Complete | SP Calls: 214,401 at 21,219.42 SP/sec |  outstanding = 43220 (3783) | min = 1039 | max = 3596 | avg = 2038.88
      [java] 12.587% Complete | SP Calls: 352,400 at 23,331.57 SP/sec |  outstanding = 39645 (-3575) | min = 859 | max = 3596 | avg = 1871.18
      [java] 16.825% Complete | SP Calls: 502,901 at 24,908.42 SP/sec |  outstanding = 38877 (-768) | min = 859 | max = 3596 | avg = 1721.95
     [java] Failed to execute!!!
     [java] Connection to database host (192.168.1.50) was lost before a response was received
     [java] null
     [java] Java Result: 255

Thanks
re: K-Safety Question
tcallaghan
Jul 12, 2010
Will,
Open ClientVoter.java and look at the AsyncCallback class:

static class AsyncCallback implements ProcedureCallback {
    @Override
    public void clientCallback(ClientResponse clientResponse) {
        final byte status = clientResponse.getStatus();
        if (status != ClientResponse.SUCCESS) {
            System.err.println("Failed to execute!!!");
            System.err.println(clientResponse.getStatusString());
            System.err.println(clientResponse.getException());
            System.exit(-1);
        } else {


If you comment-out/remove the "System.exit(-1);" line then your client will continue operating. Right now the client is set to stop when a stored procedure invocation fails.

-Tim
Thanks, I see how that works
will
Jul 13, 2010
Thanks, I see how that works