Permalink
Browse files

Merge branch 'unstable' into conf_typo_fixen

  • Loading branch information...
doismellburning committed Aug 2, 2013
2 parents 203c4fb + cd0ea1f commit 70bfc919d2bf19a2ee029335dda146bde648015d
Showing with 8,530 additions and 2,198 deletions.
  1. +7 −2 .gitignore
  2. +2 −2 00-RELEASENOTES
  3. +55 −8 MANIFESTO
  4. +14 −3 README
  5. +2 −2 deps/Makefile
  6. +2 −2 deps/hiredis/hiredis.c
  7. +10 −2 deps/hiredis/net.c
  8. +386 −109 deps/hiredis/sds.c
  9. +21 −9 deps/hiredis/sds.h
  10. +13 −0 deps/hiredis/zmalloc.h
  11. +0 −5 deps/jemalloc/.gitignore
  12. +1 −1 deps/lua/COPYRIGHT
  13. +1 −1 deps/lua/Makefile
  14. BIN deps/lua/doc/amazon.gif
  15. +79 −81 deps/lua/doc/contents.html
  16. +45 −3 deps/lua/doc/lua.css
  17. +13 −2 deps/lua/doc/manual.css
  18. +17 −14 deps/lua/doc/manual.html
  19. +2 −2 deps/lua/doc/readme.html
  20. +1 −1 deps/lua/etc/lua.pc
  21. +2 −2 deps/lua/src/Makefile
  22. +1 −1 deps/lua/src/lbaselib.c
  23. +1 −9 deps/lua/src/lcode.c
  24. +2 −1 deps/lua/src/ldblib.c
  25. +2 −1 deps/lua/src/ldo.c
  26. +1 −2 deps/lua/src/lgc.c
  27. +5 −2 deps/lua/src/liolib.c
  28. +4 −2 deps/lua/src/llex.c
  29. +2 −2 deps/lua/src/loadlib.c
  30. +2 −2 deps/lua/src/lparser.c
  31. +4 −2 deps/lua/src/lstrlib.c
  32. +4 −4 deps/lua/src/lua.h
  33. +119 −52 deps/lua/src/lua_struct.c
  34. +6 −2 deps/lua/src/lvm.c
  35. +169 −25 redis.conf
  36. +10 −5 runtest
  37. +1 −1 sentinel.conf
  38. +49 −40 src/Makefile
  39. +22 −9 src/Makefile.dep
  40. +3 −3 src/adlist.c
  41. +38 −4 src/ae.c
  42. +2 −0 src/ae.h
  43. +7 −0 src/ae_epoll.c
  44. +11 −6 src/ae_evport.c
  45. +7 −1 src/ae_kqueue.c
  46. +6 −0 src/ae_select.c
  47. +209 −72 src/anet.c
  48. +8 −4 src/anet.h
  49. +14 −9 src/aof.c
  50. +1 −1 src/bio.c
  51. +13 −10 src/bitops.c
  52. +1,147 −256 src/cluster.c
  53. +869 −44 src/config.c
  54. +15 −1 src/config.h
  55. +1 −1 src/crc16.c
  56. +76 −23 src/db.c
  57. +107 −93 src/debug.c
  58. +1 −1 src/dict.c
  59. +6 −2 src/fmacros.h
  60. +13 −3 src/help.h
  61. +4 −4 src/lzfP.h
  62. +2 −4 src/memtest.c
  63. +2 −2 src/mkreleasehdr.sh
  64. +21 −24 src/multi.c
  65. +214 −83 src/networking.c
  66. +128 −0 src/notify.c
  67. +141 −35 src/object.c
  68. +1 −12 src/pqsort.c
  69. +65 −3 src/pubsub.c
  70. +34 −30 src/rdb.c
  71. +1 −1 src/rdb.h
  72. +2 −2 src/redis-check-dump.c
  73. +369 −45 src/redis-cli.c
  74. +324 −61 src/redis-trib.rb
  75. +490 −188 src/redis.c
  76. +222 −47 src/redis.h
  77. +2 −2 src/release.c
  78. +940 −88 src/replication.c
  79. +34 −1 src/rio.c
  80. +33 −10 src/rio.h
  81. +92 −46 src/scripting.c
  82. +173 −20 src/sds.c
  83. +2 −2 src/sds.h
  84. +170 −61 src/sentinel.c
  85. +261 −0 src/setproctitle.c
  86. +18 −18 src/sha1.c
  87. +1 −1 src/slowlog.c
  88. +21 −9 src/sort.c
  89. +12 −5 src/t_hash.c
  90. +50 −17 src/t_list.c
  91. +43 −18 src/t_set.c
  92. +76 −12 src/t_string.c
  93. +68 −41 src/t_zset.c
  94. +60 −0 src/util.c
  95. +4 −0 src/util.h
  96. +1 −1 src/version.h
  97. +4 −3 src/ziplist.c
  98. +1 −1 src/zmalloc.c
  99. +5 −324 tests/assets/default.conf
  100. +1 −1 tests/integration/aof.tcl
  101. +73 −0 tests/integration/rdb.tcl
  102. +73 −3 tests/integration/replication-3.tcl
  103. +90 −8 tests/integration/replication-4.tcl
  104. +105 −0 tests/integration/replication-psync.tcl
  105. +3 −2 tests/integration/replication.tcl
  106. +4 −0 tests/support/redis.tcl
  107. +2 −2 tests/support/server.tcl
  108. +2 −0 tests/support/util.tcl
  109. +59 −2 tests/test_helper.tcl
  110. +1 −1 tests/unit/auth.tcl
  111. +49 −0 tests/unit/basic.tcl
  112. +28 −0 tests/unit/expire.tcl
  113. +37 −0 tests/unit/introspection.tcl
  114. +58 −1 tests/unit/multi.tcl
  115. +1 −1 tests/unit/obuf-limits.tcl
  116. +165 −1 tests/unit/pubsub.tcl
  117. +45 −8 tests/unit/scripting.tcl
  118. +12 −0 tests/unit/slowlog.tcl
View
@@ -1,8 +1,13 @@
.*.swp
*.o
-*.rdb
*.log
-redis-*
+dump.rdb
+redis-benchmark
+redis-check-aof
+redis-check-dump
+redis-cli
+redis-sentinel
+redis-server
doc-tools
release
misc/*
View
@@ -26,7 +26,7 @@ Also the following redis.conf and CONFIG GET / SET parameters changed name:
* hash-max-zipmap-entries, now replaced by hash-max-ziplist-entries
* hash-max-zipmap-value, now replaced by hash-max-ziplist-value
- * glueoutputbuf was no completely removed as it does not make sense
+ * glueoutputbuf was now completely removed as it does not make sense
---------
CHANGELOG
@@ -46,7 +46,7 @@ UPGRADE URGENCY: We suggest new users to start with 2.6.0, and old users to
in slaves.
* Milliseconds resolution expires, also added new commands with milliseconds
precision (PEXPIRE, PTTL, ...).
-* Clinets max output buffer soft and hard limits. You can specifiy different
+* Clients max output buffer soft and hard limits. You can specifiy different
limits for different classes of clients (normal,pubsub,slave).
* AOF is now able to rewrite aggregate data types using variadic commands,
often producing an AOF that is faster to save, load, and is smaller in size.
View
@@ -4,17 +4,64 @@
Redis Manifesto
===============
-1 - A DSL for Abstract Data Types. Redis is a DSL (Domain Specific Language) that manipulates abstract data types and implemented as a TCP daemon. Commands manipulate a key space where keys are binary-safe strings and values are different kinds of abstract data types. Every data type represents an abstract version of a fundamental data structure. For instance Redis Lists are an abstract representation of linked lists. In Redis, the essence of a data type isn't just the kind of operations that the data types support, but also the space and time complexity of the data type and the operations performed upon it.
+1 - A DSL for Abstract Data Types. Redis is a DSL (Domain Specific Language)
+ that manipulates abstract data types and implemented as a TCP daemon.
+ Commands manipulate a key space where keys are binary-safe strings and
+ values are different kinds of abstract data types. Every data type
+ represents an abstract version of a fundamental data structure. For instance
+ Redis Lists are an abstract representation of linked lists. In Redis, the
+ essence of a data type isn't just the kind of operations that the data types
+ support, but also the space and time complexity of the data type and the
+ operations performed upon it.
-2 - Memory storage is #1. The Redis data set, composed of defined key-value pairs, is primarily stored in the computer's memory. The amount of memory in all kinds of computers, including entry-level servers, is increasing significantly each year. Memory is fast, and allows Redis to have very predictable performance. Datasets composed of 10k or 40 millions keys will perform similarly. Complex data types like Redis Sorted Sets are easy to implement and manipulate in memory with good performance, making Redis very simple. Redis will continue to explore alternative options (where data can be optionally stored on disk, say) but the main goal of the project remains the development of an in-memory database.
+2 - Memory storage is #1. The Redis data set, composed of defined key-value
+ pairs, is primarily stored in the computer's memory. The amount of memory in
+ all kinds of computers, including entry-level servers, is increasing
+ significantly each year. Memory is fast, and allows Redis to have very
+ predictable performance. Datasets composed of 10k or 40 millions keys will
+ perform similarly. Complex data types like Redis Sorted Sets are easy to
+ implement and manipulate in memory with good performance, making Redis very
+ simple. Redis will continue to explore alternative options (where data can
+ be optionally stored on disk, say) but the main goal of the project remains
+ the development of an in-memory database.
-3 - Fundamental data structures for a fundamental API. The Redis API is a direct consequence of fundamental data structures. APIs can often be arbitrary but not an API that resembles the nature of fundamental data structures. If we ever meet intelligent life forms from another part of the universe, they'll likely know, understand and recognize the same basic data structures we have in our computer science books. Redis will avoid intermediate layers in API, so that the complexity is obvious and more complex operations can be performed as the sum of the basic operations.
+3 - Fundamental data structures for a fundamental API. The Redis API is a direct
+ consequence of fundamental data structures. APIs can often be arbitrary but
+ not an API that resembles the nature of fundamental data structures. If we
+ ever meet intelligent life forms from another part of the universe, they'll
+ likely know, understand and recognize the same basic data structures we have
+ in our computer science books. Redis will avoid intermediate layers in API,
+ so that the complexity is obvious and more complex operations can be
+ performed as the sum of the basic operations.
-4 - Code is like a poem; it's not just something we write to reach some practical result. Sometimes people that are far from the Redis philosophy suggest using other code written by other authors (frequently in other languages) in order to implement something Redis currently lacks. But to us this is like if Shakespeare decided to end Enrico IV using the Paradiso from the Divina Commedia. Is using any external code a bad idea? Not at all. Like in "One Thousand and One Nights" smaller self contained stories are embedded in a bigger story, we'll be happy to use beautiful self contained libraries when needed. At the same time, when writing the Redis story we're trying to write smaller stories that will fit in to other code.
+4 - Code is like a poem; it's not just something we write to reach some
+ practical result. Sometimes people that are far from the Redis philosophy
+ suggest using other code written by other authors (frequently in other
+ languages) in order to implement something Redis currently lacks. But to us
+ this is like if Shakespeare decided to end Enrico IV using the Paradiso from
+ the Divina Commedia. Is using any external code a bad idea? Not at all. Like
+ in "One Thousand and One Nights" smaller self contained stories are embedded
+ in a bigger story, we'll be happy to use beautiful self contained libraries
+ when needed. At the same time, when writing the Redis story we're trying to
+ write smaller stories that will fit in to other code.
-5 - We're against complexity. We believe designing systems is a fight against complexity. We'll accept to fight the complexity when it's worthwhile but we'll try hard to recognize when a small feature is not worth 1000s of lines of code. Most of the time the best way to fight complexity is by not creating it at all.
+5 - We're against complexity. We believe designing systems is a fight against
+ complexity. We'll accept to fight the complexity when it's worthwhile but
+ we'll try hard to recognize when a small feature is not worth 1000s of lines
+ of code. Most of the time the best way to fight complexity is by not
+ creating it at all.
-6 - Two levels of API. The Redis API has two levels: 1) a subset of the API fits naturally into a distributed version of Redis and 2) a more complex API that supports multi-key operations. Both are useful if used judiciously but there's no way to make the more complex multi-keys API distributed in an opaque way without violating our other principles. We don't want to provide the illusion of something that will work magically when actually it can't in all cases. Instead we'll provide commands to quickly migrate keys from one instance to another to perform multi-key operations and expose the tradeoffs to the user.
-
-7 - We optimize for joy. We believe writing code is a lot of hard work, and the only way it can be worth is by enjoying it. When there is no longer joy in writing code, the best thing to do is stop. To prevent this, we'll avoid taking paths that will make Redis less of a joy to develop.
+6 - Two levels of API. The Redis API has two levels: 1) a subset of the API fits
+ naturally into a distributed version of Redis and 2) a more complex API that
+ supports multi-key operations. Both are useful if used judiciously but
+ there's no way to make the more complex multi-keys API distributed in an
+ opaque way without violating our other principles. We don't want to provide
+ the illusion of something that will work magically when actually it can't in
+ all cases. Instead we'll provide commands to quickly migrate keys from one
+ instance to another to perform multi-key operations and expose the tradeoffs
+ to the user.
+7 - We optimize for joy. We believe writing code is a lot of hard work, and the
+ only way it can be worth is by enjoying it. When there is no longer joy in
+ writing code, the best thing to do is stop. To prevent this, we'll avoid
+ taking paths that will make Redis less of a joy to develop.
View
17 README
@@ -26,9 +26,20 @@ After building Redis is a good idea to test it, using:
% make test
-NOTE: if after building Redis with a 32 bit target you need to rebuild it
- with a 64 bit target you need to perform a "make clean" in the root
- directory of the Redis distribution.
+Fixing problems building 32 bit binaries
+---------
+
+If after building Redis with a 32 bit target you need to rebuild it
+with a 64 bit target, or the other way around, you need to perform a
+"make distclean" in the root directory of the Redis distribution.
+
+In case of build errors when trying to build a 32 bit binary of Redis, try
+the following steps:
+
+* Install the packages libc6-dev-i386 (also try g++-multilib).
+* Try using the following command line instead of "make 32bit":
+
+ make CFLAGS="-m32 -march=native" LDFLAGS="-m32"
Allocator
---------
View
@@ -54,8 +54,8 @@ linenoise: .make-prerequisites
.PHONY: linenoise
ifeq ($(uname_S),SunOS)
- # Make isinf() available
- LUA_CFLAGS= -D__C99FEATURES__=1
+ # Make isinf() available
+ LUA_CFLAGS= -D__C99FEATURES__=1
endif
LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI $(CFLAGS)
View
@@ -650,7 +650,7 @@ int redisReaderGetReply(redisReader *r, void **reply) {
/* Discard part of the buffer when we've consumed at least 1k, to avoid
* doing unnecessary calls to memmove() in sds.c. */
if (r->pos >= 1024) {
- r->buf = sdsrange(r->buf,r->pos,-1);
+ sdsrange(r->buf,r->pos,-1);
r->pos = 0;
r->len = sdslen(r->buf);
}
@@ -1125,7 +1125,7 @@ int redisBufferWrite(redisContext *c, int *done) {
sdsfree(c->obuf);
c->obuf = sdsempty();
} else {
- c->obuf = sdsrange(c->obuf,nwritten,-1);
+ sdsrange(c->obuf,nwritten,-1);
}
}
}
View
@@ -215,9 +215,17 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
+ /* Try with IPv6 if no IPv4 address was found. We do it in this order since
+ * in a Redis client you can't afford to test if you have IPv6 connectivity
+ * as this would add latency to every connect. Otherwise a more sensible
+ * route could be: Use IPv6 if both addresses are available and there is IPv6
+ * connectivity. */
if ((rv = getaddrinfo(addr,_port,&hints,&servinfo)) != 0) {
- __redisSetError(c,REDIS_ERR_OTHER,gai_strerror(rv));
- return REDIS_ERR;
+ hints.ai_family = AF_INET6;
+ if ((rv = getaddrinfo(addr,_port,&hints,&servinfo)) != 0) {
+ __redisSetError(c,REDIS_ERR_OTHER,gai_strerror(rv));
+ return REDIS_ERR;
+ }
}
for (p = servinfo; p != NULL; p = p->ai_next) {
if ((s = socket(p->ai_family,p->ai_socktype,p->ai_protocol)) == -1)
Oops, something went wrong.

0 comments on commit 70bfc91

Please sign in to comment.