[memcached] plindner, r467: Incorporate changes from 426:462 on trun...

commits at code.sixapart.com commits at code.sixapart.com
Tue Mar 6 11:30:46 UTC 2007


Incorporate changes from 426:462 on trunk



U   branches/multithreaded/api/perl/ChangeLog
U   branches/multithreaded/api/perl/lib/Cache/Memcached.pm
A   branches/multithreaded/api/xs/xs-requirements.txt
U   branches/multithreaded/server/ChangeLog
U   branches/multithreaded/server/configure.ac
U   branches/multithreaded/server/memcached.c
U   branches/multithreaded/server/t/expirations.t
U   branches/multithreaded/website/apis.bml
A   branches/multithreaded/website/dist/
D   branches/multithreaded/website/dist/memcached-1.2.1.tar.gz
A   branches/multithreaded/website/dist/memcached-1.2.1.tar.gz
U   branches/multithreaded/website/download.bml


Modified: branches/multithreaded/api/perl/ChangeLog
===================================================================
--- branches/multithreaded/api/perl/ChangeLog	2007-03-06 10:45:28 UTC (rev 466)
+++ branches/multithreaded/api/perl/ChangeLog	2007-03-06 11:30:44 UTC (rev 467)
@@ -1,3 +1,6 @@
+        * fix "Warning produced when flush_all called" from CDENT
+	  http://rt.cpan.org/Public/Bug/Display.html?id=22181
+
 	* support access via unix domain sockets. (Nathan Neulinger <nneul at umr.edu>)
 
 	* abstract out response parsing into own class, and add XS-module

Modified: branches/multithreaded/api/perl/lib/Cache/Memcached.pm
===================================================================
--- branches/multithreaded/api/perl/lib/Cache/Memcached.pm	2007-03-06 10:45:28 UTC (rev 466)
+++ branches/multithreaded/api/perl/lib/Cache/Memcached.pm	2007-03-06 11:30:44 UTC (rev 467)
@@ -271,7 +271,7 @@
             my $cb = $self ? $self->{cb_connect_fail} : undef;
             $cb->($host) if $cb;
             return _dead_sock($sock, undef, 20 + int(rand(10)));
-        }    
+        }
     }
 
     # make the new socket not buffer writes.
@@ -776,8 +776,8 @@
     my $line = $cmd;
     while (my $res = _write_and_read($self, $sock, $line)) {
         undef $line;
-    $ret .= $res;
-        last if $ret =~ /(?:END|ERROR)\r\n$/;
+        $ret .= $res;
+        last if $ret =~ /(?:OK|END|ERROR)\r\n$/;
     }
     chop $ret; chop $ret;
     return map { "$_\r\n" } split(/\r\n/, $ret);

Copied: branches/multithreaded/api/xs/xs-requirements.txt (from rev 462, trunk/api/xs/xs-requirements.txt)

Modified: branches/multithreaded/server/ChangeLog
===================================================================
--- branches/multithreaded/server/ChangeLog	2007-03-06 10:45:28 UTC (rev 466)
+++ branches/multithreaded/server/ChangeLog	2007-03-06 11:30:44 UTC (rev 467)
@@ -16,11 +16,43 @@
 	* Steven Grimm <sgrimm at facebook.com>: Fix an off-by-one error in the
 	  multithreaded version's message passing code.
 
+2006-12-23
+	* fix expirations of items set with absolute expiration times in
+	  the past, before the server's start time.  bug was introduced in
+	  1.2.0 with rel_time_t.  Thanks to Adam Dixon
+	  <adamtdixon at gmail.com> for the bug report and test case!
+
+2006-11-26
+	* Steven Grimm <sgrimm at facebook.com>: Performance improvements:
+	  
+	  Dynamic sizing of hashtable to reduce collisions on very large
+	  caches and conserve memory on small caches.
+
+	  Only reposition items in the LRU queue once a minute, to reduce
+	  overhead of accessing extremely frequently-used items.
+
+	  Stop listening for new connections until an existing one closes
+	  if we run out of available file descriptors.
+
+	  Command parser refactoring: Add a single-pass tokenizer to cut
+	  down on string scanning.  Split the command processing into
+	  separate functions for easier profiling and better readability.
+	  Pass key lengths along with the keys in all API functions that
+	  need keys, to avoid needing to call strlen() repeatedly.
+
+2006-11-25
+	* Steve Peters <steve at fisharerojo.org>: OpenBSD has a malloc.h,
+	but warns to use stdlib.h instead
+
 2006-11-22
 	* Steven Grimm <sgrimm at facebook.com>: Add support for multithreaded
 	  execution. Run configure with "--enable-threads" to enable. See
 	  doc/threads.txt for details.
 
+2006-11-13
+	* Iain Wade <iwade at optusnet.com.au>: Fix for UDP responses on non-"get"
+	 commands.
+
 2006-10-15
 	* Steven Grimm <sgrimm at facebook.com>: Dynamic sizing of hashtable to
 	  reduce collisions on very large caches and conserve memory on

Modified: branches/multithreaded/server/configure.ac
===================================================================
--- branches/multithreaded/server/configure.ac	2007-03-06 10:45:28 UTC (rev 466)
+++ branches/multithreaded/server/configure.ac	2007-03-06 11:30:44 UTC (rev 467)
@@ -1,5 +1,5 @@
 AC_PREREQ(2.52)
-AC_INIT(memcached, 1.2.0, brad at danga.com)
+AC_INIT(memcached, 1.2.1, brad at danga.com)
 AC_CANONICAL_SYSTEM
 AC_CONFIG_SRCDIR(memcached.c)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

Modified: branches/multithreaded/server/memcached.c
===================================================================
--- branches/multithreaded/server/memcached.c	2007-03-06 10:45:28 UTC (rev 466)
+++ branches/multithreaded/server/memcached.c	2007-03-06 11:30:44 UTC (rev 467)
@@ -47,8 +47,11 @@
 #include <limits.h>
 
 #ifdef HAVE_MALLOC_H
+/* OpenBSD has a malloc.h, but warns to use stdlib.h instead */
+#ifndef __OpenBSD__
 #include <malloc.h>
 #endif
+#endif
 
 /* FreeBSD 4.x doesn't have IOV_MAX exposed. */
 #ifndef IOV_MAX
@@ -81,9 +84,17 @@
 
     if (exptime == 0) return 0; /* 0 means never expire */
 
-    if (exptime > REALTIME_MAXDELTA)
+    if (exptime > REALTIME_MAXDELTA) {
+        /* if item expiration is at/before the server started, give it an
+           expiration time of 1 second after the server started.
+           (because 0 means don't expire).  without this, we'd
+           underflow and wrap around to some large value way in the
+           future, effectively making items expiring in the past
+           really expiring never */
+        if (exptime <= stats.started)
+            return (rel_time_t) 1;
         return (rel_time_t) (exptime - stats.started);
-    else {
+    } else {
         return (rel_time_t) (exptime + current_time);
     }
 }

Modified: branches/multithreaded/server/t/expirations.t
===================================================================
--- branches/multithreaded/server/t/expirations.t	2007-03-06 10:45:28 UTC (rev 466)
+++ branches/multithreaded/server/t/expirations.t	2007-03-06 11:30:44 UTC (rev 467)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 use strict;
-use Test::More tests => 8;
+use Test::More tests => 10;
 use FindBin qw($Bin);
 use lib "$Bin/lib";
 use MemcachedTest;
@@ -47,3 +47,8 @@
 sleep(2.2);
 mem_get_is($sock, "foo", undef, "now expired");
 
+$expire = time() - 20;
+print $sock "set boo 0 $expire 6\r\nbooval\r\n";
+is(scalar <$sock>, "STORED\r\n", "stored boo");
+mem_get_is($sock, "boo", undef, "now expired");
+

Modified: branches/multithreaded/website/apis.bml
===================================================================
--- branches/multithreaded/website/apis.bml	2007-03-06 10:45:28 UTC (rev 466)
+++ branches/multithreaded/website/apis.bml	2007-03-06 11:30:44 UTC (rev 467)
@@ -7,7 +7,7 @@
 <p> An object-oriented Perl module can be found on CPAN as <tt>Cache::Memcached</tt> or downloaded here.</p>
 <ul>
 <li><a href="dist/Cache-Memcached-1.14.tar.gz">Cache-Memcached-1.14.tar.gz</a>, GPL/Artistic.
-[<a href="http://cvs.danga.com/browse.cgi/wcmtools/memcached/api/perl/ChangeLog?rev=HEAD&amp;content-type=text/plain">ChangeLog</a>]
+[<a href="http://code.sixapart.com/svn/memcached/trunk/api/perl/ChangeLog">ChangeLog</a>]
 </ul>
 
 <p>The API takes advantage of the server's opaque flag support and
@@ -55,7 +55,7 @@
 
 
 <?h1 Protocol h1?> <p>To write a new client, check out the <a
-href="http://cvs.danga.com/browse.cgi/wcmtools/memcached/doc/protocol.txt?rev=HEAD&amp;content-type=text/plain">protocol
+href="http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt">protocol
 docs</a>.  Be aware that the most important part of the client is the
 hashing across multiple servers, based on the key, or an optional
 caller-provided hashing value.  Feel free to join the mailing list (or

Copied: branches/multithreaded/website/dist (from rev 462, trunk/website/dist)

Deleted: branches/multithreaded/website/dist/memcached-1.2.1.tar.gz
===================================================================
(Binary files differ)

Copied: branches/multithreaded/website/dist/memcached-1.2.1.tar.gz (from rev 462, trunk/website/dist/memcached-1.2.1.tar.gz)

Modified: branches/multithreaded/website/download.bml
===================================================================
--- branches/multithreaded/website/download.bml	2007-03-06 10:45:28 UTC (rev 466)
+++ branches/multithreaded/website/download.bml	2007-03-06 11:30:44 UTC (rev 467)
@@ -9,7 +9,7 @@
 <p>Main (1.2.x) series:</p>
 
 <ul>
-<li><a href="dist/memcached-1.2.0.tar.gz">memcached-1.2.0.tar.gz</a> -- Sep 9, 2006 [<a href="http://code.sixapart.com/svn/memcached/tags/1.2.0/ChangeLog">Changes</a>]
+<li><a href="dist/memcached-1.2.1.tar.gz">memcached-1.2.1.tar.gz</a> -- Dec 5, 2006 [<a href="http://code.sixapart.com/svn/memcached/tags/1.2.1/ChangeLog">Changes</a>]
 </ul>
 
 <p>Old (1.1.x) series, now maintenance releases only:</p>




More information about the memcached-commits mailing list