Commit graph

  • f0d5baeb0e WIP: more caching work, still not done. Gregory Burd 2013-05-29 14:56:38 -0400
  • a2cd1d562c WIP: devising a better way to cache/reuse session/cursor pairs. Gregory Burd 2013-05-28 16:14:19 -0400
  • 8e1e1b192d Allow clients of async_nif to set the number of concurrent workers. gsb-affinity Gregory Burd 2013-05-16 11:18:32 -0400
  • 013251e6d9 Update WiredTiger statistics less frequently and fix a build script mistake preventing checking out by branch name. Gregory Burd 2013-05-14 13:51:44 -0400
  • 4745950ad5 Another TODO item. Gregory Burd 2013-05-02 11:29:37 -0400
  • 98fffd199f Updated todo list. Gregory Burd 2013-05-02 08:41:44 -0400
  • 786142ce73 Add a bit of statistics tracking for two reasons, a) to help inform where a request should be enqueded and b) to track request latency. Gregory Burd 2013-05-01 22:02:37 -0400
  • ae64a5e26f Move async nif struct definition back to where it belongs. Gregory Burd 2013-05-01 22:02:21 -0400
  • d1d648af1e Now matches against proper library name and prevents rebuilding when unnecessary. Gregory Burd 2013-05-01 22:00:43 -0400
  • 7c9c3b78db Remove this vestige of bzip2 support. Gregory Burd 2013-05-01 21:59:54 -0400
  • 12fd9134fa Add a few placeholders for missing functions. Gregory Burd 2013-05-01 21:59:12 -0400
  • 0bde789af5 Tune the LSM a bit based on testing, increase the chunk size and add more merge worker threads into the mix. Gregory Burd 2013-05-01 07:06:13 -0400
  • d93f0bc162 A more friendly approach to make clean in c_src. Gregory Burd 2013-04-26 18:57:17 -0400
  • bfc180eeb3 Merge branch 'master' of github.com:basho-labs/wterl Gregory Burd 2013-04-26 10:37:06 -0400
  • f1cb6f8c61 Remove support for bzip2. Change build_deps.sh to only remove the build files from wiredtiger when cleaning rather than all the files. Gregory Burd 2013-04-26 10:34:57 -0400
  • eafee02865 Only start 2 * num_queues worker threads initially. num_queues is generally equal to the number of cores reported by Erlang (info.scheduler_threads) which is either determined automatically by the Erlang BEAM runtime or via the +S flag. The minimum num_queues is 2, so the minimum number of workers is 4. The maximum number of workers is ASYNC_NIF_MAX_WORKER_QUEUE_SIZE (currently set to 128), but that would only happen if there were 64 cores (or you set +S 64:64 at startup). Gregory Burd 2013-04-26 10:15:15 -0400
  • c410312c40 Switch to the develop branch. Gregory Burd 2013-04-26 10:07:10 -0400
  • 3a51afcc20 Copy paste error in patch file prevented proper build arguments for bzip2. Gregory Burd 2013-04-25 16:36:17 -0400
  • 422dcfda89 Return 'eagain' when request queue is full and then try the request again. In the worst case is the request queue remains full and we loop between the NIF and Erlang forever trying over and over to enqueue the request. If that happens we shouldn't take schedulers offline as the NIF calls are fast and we shouldn't run out of memory as that is bounded. CPU will show a lot of activity, but progress will continue in Erlang. Gregory Burd 2013-04-25 15:18:23 -0400
  • f043a99ccb Merge pull request #8 from basho-labs/gsb-recycle-reqs Gregory Burd 2013-04-25 10:26:16 -0700
  • 3aef223c31 Merge 6b393ac47c into 35e36d1cae Gregory Burd 2013-04-25 10:04:18 -0700
  • 6b393ac47c Keep allocated req and ErlNifEnv around for reuse rather than re-alloc'ing them on each request should save us some overhead on the hot path. gsb-recycle-reqs Gregory Burd 2013-04-25 11:30:11 -0400
  • 35e36d1cae Whitespace Gregory Burd 2013-04-24 14:28:24 -0400
  • 4076a1923c Driver and config for basho_bench testing. Gregory Burd 2013-04-24 14:27:56 -0400
  • 8772d39663 WIP: use atoms to speed up hash lookup of shared cursors. gsb-atoms-for-table-uris Gregory Burd 2013-04-24 10:15:46 -0400
  • 54c5158490 Merge pull request #7 from basho-labs/gsb-event-handlers Gregory Burd 2013-04-23 12:02:22 -0700
  • edbab246ce Merge 46243ff54a into 88416d1991 Gregory Burd 2013-04-23 12:00:54 -0700
  • 46243ff54a Remove debug compiler flags. gsb-event-handlers Gregory Burd 2013-04-23 15:00:44 -0400
  • 35de23c0f3 Include the gen_server module that will log events using lager. Gregory Burd 2013-04-23 08:22:48 -0400
  • 6f58faaba2 Turn on some of the verbose options, but leave most off. Gregory Burd 2013-04-22 20:55:45 -0400
  • 88416d1991 Merge pull request #6 from basho-labs/gsb-async-nifs3 Gregory Burd 2013-04-22 17:54:56 -0700
  • fc59ae3f90 WIP: Finished transitioning to a gen_server and a few other tasks. This works except that when trying to enif_send a bunch of messages eventually one causes a segv just after reporting: size_object: bad tag for 0x80 Gregory Burd 2013-04-22 17:45:48 -0400
  • 652771003e WIP: a good start, I need to switch over wterl_event_handler to be a gen_server and I need to add a way to set the pid of the message handler process to the NIF API. Gregory Burd 2013-04-22 09:52:21 -0400
  • 3398540831 Have Erlang and C compilers be a bit more picky. Gregory Burd 2013-04-21 11:16:04 -0400
  • ac59cd69dd Check return from kn_init. WiredTiger truncate doesn't require you to position cursors for the range to be truncated. Gregory Burd 2013-04-21 11:14:48 -0400
  • fae6831580 Ensure that the env is clear when signaling shutdown. Gregory Burd 2013-04-21 11:11:17 -0400
  • a282ad2f1d Improve, extend some targets. Gregory Burd 2013-04-21 11:10:06 -0400
  • 6fb086889a Merge 6c74c825e4 into a75d60bf27 Gregory Burd 2013-04-20 10:30:23 -0700
  • 6c74c825e4 Avoid calling a process that may have already exited. gsb-async-nifs3 Gregory Burd 2013-04-20 13:30:09 -0400
  • 48141346f0 Remove redundant wt from filenames. Gregory Burd 2013-04-20 12:49:14 -0400
  • a1459ce607 It's statistics:<your table name here> not table:statistics (oops). Gregory Burd 2013-04-20 12:33:36 -0400
  • b69f35364b Use the less onerous version of statistics. Gregory Burd 2013-04-20 12:27:42 -0400
  • 7380bd3bd7 Open the statistics table, not the actual table. Gregory Burd 2013-04-20 12:08:55 -0400
  • bfe56136d8 * Be sure to release the reqs mutext on shutdown. Gregory Burd 2013-04-20 08:28:38 -0400
  • 554aba4331 Truncate table isn't used by the WiredTiger Riak/KV backend API and it is currently failing. Comment out of the tests, for now. Gregory Burd 2013-04-20 08:20:45 -0400
  • 3310129918 * Check to make sure that all ASYNC_NIF_REPLY() calls are at the end of their blocks, just before return and after releasing any local resources or locks. Gregory Burd 2013-04-20 07:38:11 -0400
  • 01a79a08c0 Add a comment and remove an mutext unlock on error because this function is not where the lock is acquired. Gregory Burd 2013-04-20 06:13:41 -0400
  • be95229af9 On error when fetching stats, ignore and return whatever you have so far. Gregory Burd 2013-04-19 16:44:51 -0400
  • 17cfdcd04f Fix default tuple. Gregory Burd 2013-04-19 16:07:18 -0400
  • e9145c344c Ignore eperm on status cursors and empty cursors (for now). Gregory Burd 2013-04-19 15:46:58 -0400
  • 5d3cb9997a For now we ignore eperm and ebusy error returns on fold and drop. Gregory Burd 2013-04-19 15:09:29 -0400
  • b936b99531 Minor fix. Gregory Burd 2013-04-19 15:00:57 -0400
  • d505f7f9c8 Whitespace. Call wterl:drop not truncate for drop calls and set force to true when calling so that we ignore ENOENT. Change the session estimate down a bit. Gregory Burd 2013-04-19 14:55:32 -0400
  • 40bdda15bb Create links for bzip2 shared libraries. Gregory Burd 2013-04-19 12:33:20 -0400
  • 7b1dcb507d Need to copy shared library links for bzip2 as well (duh). Gregory Burd 2013-04-19 11:14:03 -0400
  • 203fa1a54d Merge branch 'gsb-async-nifs3' of github.com:basho-labs/wterl into gsb-async-nifs3 Gregory Burd 2013-04-19 11:06:25 -0400
  • 01a8926160 Shared libs and files linking to them must be copied into our priv dir so that at runtime we can find the correct files. Gregory Burd 2013-04-19 11:03:40 -0400
  • 8d8ceecc8b enif_get_string can return < 1 when it copies less than the buffer size you pass into it, that'd result in a non-zero (aka true) test when in fact it's a problem if the argument isn't passed completely (however unlikely that is). Gregory Burd 2013-04-19 09:11:41 -0400
  • 7a1e683a47 Working toward a more automated valgrind. Gregory Burd 2013-04-18 17:07:27 -0400
  • 95d8a28453 Remove unused num_contexts count. Cleanup the session/cursor cache init process. Gregory Burd 2013-04-18 13:36:24 -0400
  • 728d2281e0 Ensure that we init the shared cache when asking for a cursor before asking for a session. Gregory Burd 2013-04-18 12:24:49 -0400
  • 846f7f72ba Must compile before commit, must compile before commit... Gregory Burd 2013-04-18 12:01:34 -0400
  • 7a148b9f19 get, put, delete don't use sessions, only cursors so don't fetch the shared session. Gregory Burd 2013-04-18 11:59:10 -0400
  • 83bca853f3 Store copies of Uri as keys in the hash table. Gregory Burd 2013-04-18 11:47:12 -0400
  • 60dd048b7e Move the FIFO Queue implementation into its own file (fifo_q.h). Work on the nif_unload path. Free up resources owned by wterl.c when unloading. Continue to evolve the build script. Add to khash the ability to create a hash that maps from a pointer to a value. There is still a segv due to a race wterl.c:do_unload() which needs to be addressed. Gregory Burd 2013-04-18 10:32:29 -0400
  • db953f5b39 Moved num_queue estimate earlier so as to ensure that the amount of memory allocated, zero'ed and free'd was consistent. Skip free'ing async environment as Erlang will free that for us when we no longer reference it. Fix the memory leak (or at least one of them) by no longer copying the Uri into the hash table. Gregory Burd 2013-04-17 18:26:59 -0400
  • 1ae8e5698f Ensure that the ratio of workers to queues is 2:1 and that there are at least 2 queues regardless. Fix a few race conditions (h/t Sue from WiredTiger for some nice work) and cherry pick (for now) a commit that fixes a bug I triggered and Keith fixed (in < 10min from report) related to WiredTiger stats. Ensure that my guesstimate for session_max is no larger than WiredTiger can manage. Continue to fiddle with the build script. Gregory Burd 2013-04-17 16:48:23 -0400
  • f664c303d8 Disable prefix compression (for now). Gregory Burd 2013-04-17 14:23:56 -0400
  • 123dfa600e Simplified the worker look function. Added ability to pick block compressor in config, default is snappy, off is {block_compressor, none}. Gregory Burd 2013-04-17 13:19:06 -0400
  • 87f70d75a1 Inline the fifo_q functions to speed them up and silence compiler warnings for unused API calls. Add a fifo_q_full call to hide the details of that. Alloc work queues along with the async_nif at the end of that memory block. Fix a few places where things should be free'd and were not. Change enqueue to return 0 when shutting down. Fix a race related to shutdown. When I use gdb eunit calls ?cmd() seem to fail, so I've created rmdir:path() to replace ?cmd("rm -rf path") calls. Gregory Burd 2013-04-17 11:17:13 -0400
  • 1913e7fdf5 Continue to iterate on the build system to accomodate shared libs. Gregory Burd 2013-04-16 21:46:53 -0400
  • 5e80477d4a Merge remote-tracking branch 'origin/gsb-async-nifs3' into gsb-async-nifs3 Gregory Burd 2013-04-16 19:34:11 -0400
  • 13a9036764 So, WiredTiger prefers that extensions be shared libraries however those extensions reference other shared libraries. Previously I tried to turn all those shared libs into static libs, however that didn't pan out so well. So now the libwiredtiger.so library is loaded by wterl.so also, later on during use libwiredtiger.so will load libwiredtiger_snappy.so and libwiredtiger_bzip2.so which now have libsnappy.a and libbz2.a respectively linked statically so as to avoid confusion. Gregory Burd 2013-04-16 19:31:10 -0400
  • 76d7a7d0a3 Revert a small change Gregory Burd 2013-04-16 17:20:57 -0400
  • 2d077a0baf Explicitly close cursors we open despite knowing they'll be closed with the session later. Gregory Burd 2013-04-16 17:15:23 -0400
  • 3dab6a2dc5 Clean up Gregory Burd 2013-04-16 17:09:34 -0400
  • 36c1d3f829 Move things around in the build script to get a bit of reuse. Gregory Burd 2013-04-16 16:24:04 -0400
  • bd4d852a19 Remove wildcards from the patch file names and fix checkout of wiredtiger repo to pull and track remote branch. Gregory Burd 2013-04-16 17:41:00 +0000
  • 249c600554 Switching back to static linking to avoid platform issues and have confidence when in deployment of what code is being used. Gregory Burd 2013-04-16 11:47:04 -0400
  • 941bb0a929 Whitespace Gregory Burd 2013-04-16 11:46:51 -0400
  • ba41dd7fb6 Use the table name in get/put/delete calls to form an "affinity" with a worker queue so that we spread work around and make it more likely that work for a given table goes first to a given set of worker threads. Gregory Burd 2013-04-15 18:46:06 -0400
  • 371779d14e Return to alloc'ed requests because there may be many more in flight than those in the various queues. Reenable the (still failing) truncate tests (because they don't SEGV anymore). Still might be a memory leak, next up is valgrind. Gregory Burd 2013-04-15 17:37:14 -0400
  • 668109de25 Added match/gt/lt atom return for cursor_search_near() call. Changed the request queue over to a simple fifo queue which could (if needed) be made lock-free. Cursor searches can optionally now specifiy that they are mid-scan so as not to have their cursor handles reset every call. Gregory Burd 2013-04-15 15:22:12 -0400
  • e37c5b68d9 Type-o fixed. Gregory Burd 2013-04-15 00:25:00 -0400
  • cc73310cb3 Missed a change. Gregory Burd 2013-04-15 00:11:48 -0400
  • 5ba491adfa We don't use the scheduler id from Erlang anymore in async_nif so stop sending it over. Allow the user to set a "type" of storage in their config to either 'table' for btree or 'lsm' for a log structured merge tree. Various other cleanup. Gregory Burd 2013-04-15 00:08:01 -0400
  • 9ed2137730 A bit of cleanup Gregory Burd 2013-04-14 19:33:14 -0400
  • 15a9a70c41 bzero isn't portable, use memset instead. Include bzip2 and snappy source for use by WT block compression Super-User 2013-04-14 21:23:57 +0000
  • 22643fc312 Change from waking up all threads to waking up one thread. Gregory Burd 2013-04-14 13:54:45 -0400
  • 8fe9dc9bad This is a different approach from async2, instead of a single queue and many workers this has a queue per scheduler and a few workers per queue. Gregory Burd 2013-04-14 08:44:54 -0400
  • 456129e7f3 Reusing closed cursors is bad for your health (SEGV), don't do that. Also a bit of paranoia, bzero after all enif_alloc calls. Gregory Burd 2013-04-12 16:59:10 -0400
  • 1962640382 Move the cleanup code into conn_close and remove the need for a dtor function for resource GC/cleanup. It's easier. Gregory Burd 2013-04-12 16:09:00 -0400
  • b0ca1e4098 WIP -- 41 tests pass, 3 fail = progress! Right now I have the connection dtor commented out, otherwise it would SEGV on GC. Some of the truncate tests fail (race?) but don't SEGV, so that's not so bad. Fixed numerous issues and also removed a mutex and queue of idle worker threads because it isn't used so why bother with it? Gregory Burd 2013-04-12 15:25:56 -0400
  • 5a73264307 WIP -- Most tests passing, truncate and drop failing due to EBUSY, also not sure why there is a segv when exiting but not in gdb. Unlock mutex before returning error codes. Alloc/free copies of some strings allocated on the stack. Gregory Burd 2013-04-11 11:57:41 -0400
  • 5c0295624d WIP -- most tests running, a few commented out, sometimes a segv on exit Gregory Burd 2013-04-08 17:21:48 -0400
  • 07061ed6e8 WIP -- more tests passing, plenty left to fix Gregory Burd 2013-04-07 22:16:44 -0400
  • 3b41805a71 WIP -- continue to fix tests in wterl Gregory Burd 2013-04-07 10:07:19 -0400
  • 5ac006630e WIP -- tests failing -- WIP Fixed numerous bugs. Pushed config_to_bin down to just before calling the _nif() function, everywhere else config is a proplist. Gregory Burd 2013-04-07 09:21:47 -0400
  • 2675aa501a Opening a connection now involves passing in both a configuration string for the connection and for any sessions. Don't convert configuration proplists into strings (Erlang binaries) until calling into the NIF layer. Gregory Burd 2013-04-06 17:19:59 -0400
  • 07592f20fb Use non-cursor ops for get/put/delete because under the covers they are reusing sessions and cursors in the NIF layer. Keep two cursors open for just the house keeping tasks, is_empty and stats. Gregory Burd 2013-04-06 17:17:50 -0400