commit cc303c883dd83d67acbaf31e754847e98ddbfce7 Author: Alberto Bertogli Date: Mon Mar 2 20:25:09 2009 -0200 Add missing #include Signed-off-by: Alberto Bertogli commit f294e72a09ac447b0aa518a5d914b0e7903665d1 Author: Alberto Bertogli Date: Tue Dec 9 20:16:56 2008 -0200 Add Python 3 bindings They're obviously based on Python 2 bindings, and have the same API. Signed-off-by: Alberto Bertogli commit b28ae38be6a3cfae3cb5ce27b63b4e8372eaa871 Author: Alberto Bertogli Date: Sun Dec 7 12:01:31 2008 -0200 python: Fall back on pickle when cPickle is not available Signed-off-by: Alberto Bertogli commit 199492d29d83f59823d2fec53660f82417b763d4 Author: Alberto Bertogli Date: Sun Dec 7 11:53:12 2008 -0200 python: Fix key selection when autopickling When autopickling is enabled, we select the key using str(hash(key)), which is stupid (and non portable) because the hash() of some classes is just the object's memory address, which is obviously not stable across invocations. The fix is to just use pickle to select the key. Thanks to Kelvin (lbh1976@gmail.com) for the bug report. Signed-off-by: Alberto Bertogli commit 582a0a01afc29903253f24d98abdb015d92fe6e1 Author: Alberto Bertogli Date: Sun Dec 7 11:47:24 2008 -0200 python: Properly cast the buffer arguments to PyString_FromStringAndSize() PyString_FromStringAndSize() expects a char *, and we're giving them an unsigned char *, which makes the compiler complain. So we just cast it, there's no downside because PyString_FromStringAndSize() doesn't really care about what's in the buffer. Signed-off-by: Alberto Bertogli commit a25933b0dc80e3dc730e350537f2ec8689626131 Author: Alberto Bertogli Date: Thu Dec 4 22:53:48 2008 -0200 Make req.cmd be 16 bits wide instead of 32 It's 16 bits wide on the network, and the code properly assumes so. There's no need for it to take 32 bits in the structure (and it's misleading too). Signed-off-by: Alberto Bertogli commit 788a49b302b91b3f3d8e57eb515b4f9d21ef66f7 Author: Alberto Bertogli Date: Thu Dec 4 22:50:51 2008 -0200 Build nmdb-stats against the local library (if possible) Without this, nmdb can't complete a top-level "make" unless the library has been previously installed. And even then, we would be building nmdb-stats against a possible previous version, which is undesirable. This patch fixes this by simply adding the local libnmdb path to the include and library search paths. Signed-off-by: Alberto Bertogli commit 8b58fe7dd2ef4bd152417145bb5467bd4641fe97 Author: Alberto Bertogli Date: Thu Oct 30 18:19:06 2008 -0200 Fix the pkg-config file to link against nmdb and not qdbm Signed-off-by: Alberto Bertogli commit bc9170cd0ed2d9773942a279ae83cab4b73d5310 Author: Alberto Bertogli Date: Thu Oct 30 18:17:21 2008 -0200 Add SCTP options to getopt() The parsing was ready, but the options were not passed to getopt(). This patch adds the two SCTP-related options (-s and -S) to the getopt() parameter. Signed-off-by: Alberto Bertogli commit 8967449df72ff19d43fab4a6bb7bf91903c338b0 Author: Alberto Bertogli Date: Fri Oct 3 12:55:28 2008 -0300 Add tokyocabinet backend This patch adds support for tokyocabinet (http://tokyocabinet.sf.net/index.html) as a backend. Signed-off-by: Alberto Bertogli commit 31201b0650c5df9a89797ae581b68d31351da8f2 Author: Alberto Bertogli Date: Sat Aug 23 15:53:54 2008 -0300 "const"ify struct req_info pointers that are passed around They are never modified, so mark them constant to be able to enforce this fact and make the code more explicit. Signed-off-by: Alberto Bertogli commit 1259c7bb5bb7a2b87a58ffcb0436baddba6ca612 Author: Alberto Bertogli Date: Sat Aug 23 14:41:45 2008 -0300 Document the API change in the UPGRADING document Signed-off-by: Alberto Bertogli commit d32d66ca545d5213ebf3366a489e0050eb6c28a7 Author: Alberto Bertogli Date: Sat Aug 23 13:37:47 2008 -0300 Create put_in_queue() and put_in_queue_long() to avoid code duplication In parse.c, everything that enqueue requests perform almost the same operations. This patch creates a new pair of functions, put_in_queue() and put_in_queue_long(), to make the code more clear and avoid duplication. Signed-off-by: Alberto Bertogli commit bdedf60ba51a9b9f61ada045378a9376a91d1cae Author: Alberto Bertogli Date: Mon Aug 4 19:49:35 2008 -0300 Create find_in_cache() to simplify using find_in_chain() This patch adds a new funcion to cache.c, find_in_cache(), that can be used to find an entry in the cache. It's useful to avoid doing the calculation in the open using find_in_chain() when having a reference to the chain is not useful. Signed-off-by: Alberto Bertogli commit caf2db302319027dd72c660a4c03d54b9fcb9791 Author: Alberto Bertogli Date: Sun Aug 3 01:47:47 2008 -0300 Minor documentation fixes Signed-off-by: Alberto Bertogli commit 130ba0a7750dc3380652d3bfb8b57472aa4c8209 Author: Alberto Bertogli Date: Sat Jul 26 19:26:02 2008 -0300 Improve Makefile for profiling and profile-driven optimization Signed-off-by: Alberto Bertogli commit 85fc52bea0d238a404873d6f034958015ab71142 Author: Alberto Bertogli Date: Fri Jul 25 21:03:13 2008 -0300 Update and improve several comments inside the library Signed-off-by: Alberto Bertogli commit 230452ee72213a14cfd5afc5181f45d3cf806ab9 Author: Alberto Bertogli Date: Fri Jul 25 20:48:27 2008 -0300 Build the tests only when needed Signed-off-by: Alberto Bertogli commit b5fb96ff5887fd67652f4f9933f2e9684dddc84d Author: Alberto Bertogli Date: Fri Jul 25 20:43:25 2008 -0300 Add scripts for automated performance testing This patch introduces two new scripts inside tests/perf: perf.sh and ag.sh. They depend on being used in a git repository. perf.sh can run the C tests with different parameters and graph the results. The results will be named after the current git commit. A single run takes about 9 minutes on an Intel Core 2 Duo E8400 (3.0Ghz). ag.sh can aggregate the results of the perf.sh runs across different commits, creating comparative graphs. Together, they can be used to track performance regressions in the common operations. Signed-off-by: Alberto Bertogli commit 8d70b173ff7cbd288917087f1410d96f4dcb8c35 Author: Alberto Bertogli Date: Fri Jul 11 14:41:45 2008 -0300 Update my email address and nmdb's website location Signed-off-by: Alberto Bertogli commit 7a60adf8d00156231023830b943754f0e1d2b3d8 Author: Alberto Bertogli Date: Fri Jul 11 14:26:29 2008 -0300 Simplify find_in_chain() loop The code fits a for loop perfectly, and it's more clear that way. Signed-off-by: Alberto Bertogli commit fb8da7a63124143a63a77f90c542b888ec2fe507 Author: Alberto Bertogli Date: Tue Jun 24 22:35:40 2008 -0300 Make net-const.h a symlink There is no need to keep copying it when we can use a symlink. Signed-off-by: Alberto Bertogli commit 5984f3b0d4d5c1d1da6869416025c38cad584beb Author: Alberto Bertogli Date: Sun Jun 22 21:47:30 2008 -0300 Make nmdb-stats' help() static It's more tidy that way. Caught by sparse. Signed-off-by: Alberto Bertogli commit d91eb55fd7f55210054216f29ee39377a5e2a49b Author: Alberto Bertogli Date: Sun Apr 1 01:47:08 2007 -0300 Add sparse annotations for queue lock checking Signed-off-by: Alberto Bertogli commit 4d3dba5bd6b624572d880ffa54fea565e1e046f2 Author: Alberto Bertogli Date: Sun Jun 22 21:09:40 2008 -0300 [API BREAK] Make increment return the incremented value It is often useful to have the result of the increment atomically. This patch modifies the server and the client to return the incremented value, and updates the documentation and bindings accordingly. Signed-off-by: Alberto Bertogli commit e97b3e9ab8aca33f481f1fea2479fa6a328eb4f7 Author: Alberto Bertogli Date: Sun Jun 22 20:54:28 2008 -0300 Move htonll() and ntohll() to a common, shared file As we expect to use these functions in different places in the future, it makes no sense anymore to have this code duplicated inside their users. So move them to a common file, and use symlinks because it's not worth the trouble of having a common directory for just to files (yet). Signed-off-by: Alberto Bertogli commit 6fa4ef45e1f4917ca7d01aa1bba2c7fec83267a8 Author: Alberto Bertogli Date: Thu Jun 5 20:53:35 2008 -0300 Fix timer.h usage example Signed-off-by: Alberto Bertogli commit 158e4a9dd27a733c3a33ccd2db352a9729403ae7 Author: Alberto Bertogli Date: Wed Jun 4 19:00:09 2008 -0300 Tidy some (library internal) definitions Sparse (correctly, as usual) complained about some inconsistencies in the definitions, this patch fixes them. It makes the code not only more correct, but also clearer and easier to read. Signed-off-by: Alberto Bertogli commit e264b2e25d8fad903ca00ab6e496e80e0c5ec9cf Author: Alberto Bertogli Date: Wed Jun 4 02:15:24 2008 -0300 Use request flags instead of having lots of different requests Currently, on the wire we have different requests for what actually are alternatives of the same request (for instance, a set request can be either REQ_SET_SYNC, REQ_SET_ASYNC or REQ_CACHE_SET). Internally, they're handled with the same code, except the alternatives are considered. This patch removes these different requests and adds flags instead, both on the protocol and on the internal API, which make the code more clear. Because we're not in a stable release, upgrading the protocol version is not worth the trouble. Signed-off-by: Alberto Bertogli commit ea5ce9834b1a3f5cd9607a7567d83188682fb8ac Author: Alberto Bertogli Date: Wed Jun 4 13:11:33 2008 -0300 Update the documentation to reflect latest changes The docs were lagging behind a bit, this patch brings it up to date and improves wording while we're at it. Signed-off-by: Alberto Bertogli commit ad09c429a208af5a7ea9d46996d784248ebe8d3f Author: Alberto Bertogli Date: Tue Jun 3 20:31:54 2008 -0300 Add python's build directory to .gitignore Signed-off-by: Alberto Bertogli commit c8cf39b51a03f8ae21c9cd79dd4e915d7fced95e Author: Alberto Bertogli Date: Wed Jun 4 01:36:30 2008 -0300 Allow random tests to take a key prefix This makes running several tests in parallel, with the guarantee they will not step on each other's keys. Signed-off-by: Alberto Bertogli commit 9fd09c020ed5aff22f6e7c5bd9cb634b55cb8258 Author: Alberto Bertogli Date: Wed Jun 4 01:28:07 2008 -0300 In the random tests, handle history printing when there is none Signed-off-by: Alberto Bertogli commit f815f63ee6b07d5105b0ae23f35269c433df4ea6 Author: Alberto Bertogli Date: Wed Jun 4 01:19:02 2008 -0300 Make common functions for request handling in the library Instead of having duplicate code for creating the request buffer, setting the header and adding the payload, use some simple common functions. They're obviously not exported and quite specific to this use, but make the resulting code much nicer. Tested extensively with the random1.py test. Signed-off-by: Alberto Bertogli commit 2af0a2049e9807d797f0bd06abc1fc9177ae82d9 Author: Alberto Bertogli Date: Sun Jun 1 02:58:05 2008 -0300 Define _XOPEN_SOURCE to 600, as we (should) comply with SuSv3 At the moment, we don't rely on anything that SuSv2 didn't provide except strtoll(), but it's likely that in the future we will (either intentionally or not). Signed-off-by: Alberto Bertogli commit 3409d9da8eda35081a0bef80487f5491a74b9715 Author: Alberto Bertogli Date: Sun Jun 1 01:35:53 2008 -0300 Remove some unnecessary forward declarations Signed-off-by: Alberto Bertogli commit 83b6f4ac045b21c9cd79ac795f548f9a5cd72cff Author: Alberto Bertogli Date: Sun Jun 1 01:33:07 2008 -0300 Mark functions as static in the network abstractions There is no need to export these functions, because they're not used by name outside their respective files. Use via function pointers is not affected by this. Caught by sparse. Signed-off-by: Alberto Bertogli commit a43aaaebd9b67b95d811f2189aac936ef298ed5c Author: Alberto Bertogli Date: Sun Jun 1 01:31:17 2008 -0300 Make logfd static, it's not used outside log.c Signed-off-by: Alberto Bertogli commit 0a81b54d3d45a026d45ac5beb45063d2cc2938aa Author: Alberto Bertogli Date: Sun Jun 1 01:10:26 2008 -0300 Log a simple message when starting up Logging a startup message makes start/stop tracking in logs much easier. Signed-off-by: Alberto Bertogli commit 0f2ab7ed06e00858b0ab7226ce15dc527372719b Author: Alberto Bertogli Date: Sun Jun 1 01:07:15 2008 -0300 Simplify log_init() and log_reopen() Signed-off-by: Alberto Bertogli commit ef3c2b1b2a91904b630573417e88946993c82e06 Author: Alberto Bertogli Date: Sun Jun 1 00:57:35 2008 -0300 Make SIGUSR1 reopen the log file It's quite common for log rotators to move the log file and then signal the daemon to reopen it. This patch allows this by making SIGUSR1 causing a reopening of the log file. Signed-off-by: Alberto Bertogli commit eb583f656d3f611816198ffb48775d1228561689 Author: Alberto Bertogli Date: Sun Jun 1 00:55:52 2008 -0300 Set a decent mode when creating the log file If we don't set the mode at creation time, it can end up with totally broken permissions. Signed-off-by: Alberto Bertogli commit 0b856ce9d403c8fec072e9d23b33c444283f54ea Author: Alberto Bertogli Date: Sun May 25 23:37:53 2008 -0300 Expand the comment on ordering guarantee in the network document Thanks to Rodrigo Campos (rodrigocc@gmail.com) for reporting. Signed-off-by: Alberto Bertogli commit 79ad211b5d6fb6b08b7e11d9c81c5989cc81e3d8 Author: Alberto Bertogli Date: Sun May 25 22:31:13 2008 -0300 Fix typos in the user guide Thanks to Rodrigo Campos (rodrigocc@gmail.com) for reporting. Signed-off-by: Alberto Bertogli commit 0c21b2c408ad34928160d0c286d2daed4db7a459 Author: Alberto Bertogli Date: Sat Mar 22 21:02:47 2008 -0300 Add haskell to the top level LICENSE file, and sort bindings/ entries Signed-off-by: Alberto Bertogli commit 545e55beff42f415a47e8e2d36916750224c900d Author: Alberto Bertogli Date: Sat Mar 22 20:40:44 2008 -0300 Fix recursive make invocations Make should be invoked using $(MAKE), not by calling "make" directly. That breaks, among other things, when make is not gmake or when trying to use -jN. Signed-off-by: Alberto Bertogli commit 842e0bc1bc5126436159f0ad63c085a6ce928191 Author: Alberto Bertogli Date: Sat Mar 22 19:21:50 2008 -0300 Remove references to the mailing list It has been unused so just redirect to my mail address directly. Signed-off-by: Alberto Bertogli commit 0635062659b1d7bf0a1ef0f9be4186be227742df Author: Alberto Bertogli Date: Tue Nov 27 19:37:15 2007 -0300 Improve the help message for the -o option. Signed-off-by: Alberto Bertogli commit 7d3cc608ac701ee292093eabfe745cc7bb1da24a Author: Alberto Bertogli Date: Thu Oct 11 05:05:25 2007 -0300 Add a nmdb-stats. It is a small tool that can be used to query the stats of a given server. Signed-off-by: Alberto Bertogli commit e1c28f7e9304ab77cd9c7ba972585587ac72e23a Author: Alberto Bertogli Date: Thu Oct 11 04:51:33 2007 -0300 Implement nmdb_stats() in the C client. No documentation yet, but completely functional. Signed-off-by: Alberto Bertogli commit 6b1996e8367870410fcfcf98d91e1ce40207bf68 Author: Alberto Bertogli Date: Thu Oct 11 04:45:50 2007 -0300 Implement a REQ_STATS command in the server. This allows a client to query the stats from the server. Signed-off-by: Alberto Bertogli commit 646fd0f95fe65d06b4e6bfa6e383ecd621dc8d3b Author: Alberto Bertogli Date: Thu Oct 11 04:32:47 2007 -0300 Fix minimum message size checks. The checks for all the protocols were wrong: SCTP, TIPC and UDP had it too low (2 bytes), and TCP too big (12 bytes). The minimum message size is 8 (4 version + ID, 4 command). We never catched the TCP problem until now because all commands had payloads and were >= 12 bytes. Signed-off-by: Alberto Bertogli commit 00e67abb6b27389beccfdffc4ac123713fc982bc Author: Alberto Bertogli Date: Thu Oct 11 01:11:07 2007 -0300 Add a more complete stats structure and fill it where appropriate. There's still no way of getting the stats, that will come in following patches. Signed-off-by: Alberto Bertogli commit d743e437504418ef1ae8047929e6eb133613930a Author: Alberto Bertogli Date: Thu Oct 11 01:14:38 2007 -0300 Show "CC" instead of the full gcc line by default. It makes output nicer and warnings easier to spot. The full output is still available with make V=1. Signed-off-by: Alberto Bertogli commit a053e9a027479032a1869c4871323bda2b3850df Author: Alberto Bertogli Date: Wed Oct 10 00:45:15 2007 -0300 Add a pkg-config file for libnmdb. The path where to install the .pc file is dubious. The manpage says "_prefix_/lib/pkgconfig" so it's not very clear. We just install it to our $(PREFIX)/lib/pkgconfig, which is usually the right place. Signed-off-by: Alberto Bertogli commit c6f9dcda953a26920c4505ccae5a7760cbad5782 Author: Alberto Bertogli Date: Tue Oct 9 23:34:59 2007 -0300 Use pkg-config to know which qdbm build flags to use. This makes it easier to have qdbm headers and libs in different places. As an example, Gentoo places the headers in /usr/include, but Ubuntu puts them in /usr/include/qdbm. Signed-off-by: Alberto Bertogli