-
R=1, D=1, S=1: V
-
R=2, D=1, S=1:
- V
- 503 Service Unavailable
-
R=2, D=1, S=2:
diff --git a/couchjs/c_src/SConscript b/couchjs/c_src/SConscript | |
index 757e028..0693f60 100644 | |
--- a/couchjs/c_src/SConscript | |
+++ b/couchjs/c_src/SConscript | |
@@ -17,7 +17,10 @@ def require_lib(name): | |
print 'Could not find required library', name | |
Exit(1) | |
-env = Environment(CCFLAGS='-g -O2 -DXP_UNIX') | |
+env = Environment(CCFLAGS='-g -O2 -DXP_UNIX', |
In a BigCouch cluster, there are N
replicas, who can either be in the state alive or dead. The case of all replicas being alive is defined as the absence of network partitions, i.e., no message is lost. Network partitions are modeled as total failure of one or more replica. For instance, take a set of network partitions P
. For each network partition Pi
, all replicas that are located in a different network partition than Pi
, are defined as dead.
When there's a read or write request, the request first hits one of the replicas, which is referred to as the leader. The leader starts a voting round, i.e., it forwards the request to all replicas. When the leader receives a response from a replica, it's said that the replica has voted. A response may either contain a document version, or some error code indicating e.g. that the document was not found, or the revision number of a newly created document version.
If at least
#! /bin/sh -e | |
inotifywait -m -r --exclude "\.swp$" -e modify . | xargs -n 1 -I {} echo "couchapp push" | bash |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rest_client' | |
require 'json' | |
require 'cgi' | |
def bye | |
abort("Usage: #{$0} [view_url]\nExample: #{$0} http://admin:secret@127.0.0.1:5984/db/_design/ddoc/_view/recent-posts") |
for i in `git fsck --full | grep "dangling commit" | head | grep -o -E "[0-9a-f]+$"`; do git show $i | vim -; done |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rest_client' | |
require 'json' | |
require 'cgi' | |
def bye | |
abort("Usage: #{$0} [log_file(s)] [couch_db_url]\nExample: #{$0} log/* http://admin:secret@127.0.0.1:5984/db") |
fun(Head, {Req}) -> | |
Fun = fun({Row}, {PrevKey, RowCount}) -> | |
Key = case couch_util:get_value(<<"key">>, Row) of | |
K when is_list(K) -> hd(K); | |
K -> K | |
end, | |
Doc = couch_util:get_value(<<"value">>, Row), | |
DocJson = couch_util:to_binary(couch_util:json_encode(Doc)), | |
KeyJson = <<"{\"key\":\"",Key/binary,"\"">>, |
# MySQL Service | |
description "MySQL Server" | |
author "Mario Limonciello <superm1@ubuntu.com>" | |
start on (net-device-up | |
and local-filesystems | |
and runlevel [2345]) | |
stop on runlevel [016] |
#!/bin/bash | |
if ! [ $1 ]; | |
then | |
echo syntax: $0 host [-v] | |
exit | |
fi | |
if [ "$2" == "-v" ]; | |
then |