Skip to content
Snippets Groups Projects
  1. Dec 09, 2011
  2. Nov 30, 2011
  3. Nov 29, 2011
  4. Nov 25, 2011
  5. Nov 10, 2011
  6. Nov 07, 2011
  7. Nov 04, 2011
    • Konstantin Osipov's avatar
      Blueprint incremental-rehash: review fixes. · bb75288d
      Konstantin Osipov authored
      Add comments.
      Rewrite put_slot loop to make it *both* clear and efficient.
      
      There is no need to check for equality in put_slot loop
      once we meet first non-dirty element: a non-dirty
      link indicates the end of the collision chain.
      
      Do not move elements up the chain in put_slot loop:
      we may use index in the hash/tree as tuple
      id in secondary keys.
      bb75288d
  8. Oct 28, 2011
    • Konstantin Osipov's avatar
      Lua: make it possible to create new fibers. · 3e2adffb
      Konstantin Osipov authored
      Add box.fiber.create(), box.fiber.resume(),
      fiber.yield(), box.fiber.detach().
      
      Add tests.
      
      Makce fiber cancellation implementation
      more robust and quick, so that it
      is actually usable from Lua.
      Debug.
      3e2adffb
  9. Oct 17, 2011
  10. Oct 13, 2011
  11. Oct 05, 2011
  12. Oct 03, 2011
  13. Sep 16, 2011
  14. Sep 15, 2011
  15. Sep 14, 2011
  16. Sep 09, 2011
  17. Sep 02, 2011
  18. Aug 25, 2011
    • Konstantin Osipov's avatar
      Lua: mature the implementation CALL command in the binary protocol. · 58f5c07e
      Konstantin Osipov authored
      Fix a bug when Lua transaction was rolled back
      twice when Lua procedure was invoked from CALL.
      
      Change the way arguments to and from CALL
      statement in the binary protocol are passed:
      we used to pass everything from the wire as a single
      binary blob. Now every field of the received
      tuple is passed in as a separate string argument.
      
      Everything passed back from Lua is converted to a tuple. This
      makes CALL response similar to one of SELECT.
      
      Improve box.pack() to convert its argument to integer when
      necessary. Add an argument count check to box.pack().
      Additionally, now box.pack() can be used to pack
      operations of 'UPDATE'.
      
      Use tarantool_lua_tostring() in iov_add_ret():
      this function is now used to convert return values to
      the binary protocol in box_lua.m. This is necessary
      if we try to send boolean or nil over the
      binary wire, since Lua C API lua_tostring()
      does not convert them.
      
      Add box.lua - a system Lua script
      compiled into Tarantool and containing a bunch
      of Lua code preloaded at startup.
      
      Populate box.lua with implementation
      of basic Lua functions:
      box.select(), box.update(), box.replace(),
      box.insert() (currently an alias for box.replace()),
      box.delete(). They are all wrappers around box.process().
      
      Move box_lua_init() to the beginning of mod_init(),
      since Lua in future can be used in recover().
      
      Fix a wrong assumption about the contents
      of Lua stack in iov_add_multret().
      
      Update sql.g Python SQL grammar to allow
      an empty argumeent list for procedure in CALL
      statement.
      
      Add initial documentation on Lua procedures.
      
      Add more Lua tests.
      
      Unrelated: rename INSERT to REPLACE, and UPDATE_FIELDS to
      UPDATE.
      Remove SELECT_LIMIT, which is not used any more.
      58f5c07e
  19. Aug 22, 2011
  20. Aug 19, 2011
    • Konstantin Osipov's avatar
      Lua: improve the way Lua procedures return results. · 6df557bb
      Konstantin Osipov authored
      Instead of using "print" and fiber->iov
      to return results to the client, change the Lua procedures
      implementation to simply send to the client all return values
      of a procedure. A procedure, in turn, can return tuples, integers
      (and, in future, strings, Lua tables or whatever).
      
      This allows nicely to call one procedure from another, and use its
      results in Lua, and call the very same procedure from the binary
      protocol, and still be able to process its results on the client.
      6df557bb
    • Konstantin Osipov's avatar
      Lua: prepare to intercept box.process results into Lua. · ccd61773
      Konstantin Osipov authored
      Remove dead code from txn_cleanup(), which
      would check that txn_cleanup() is not called twice:
      this code is from the time when we used
      
      Rename txn_abort() to txn_rollback().
      Rename txn_alloc() to txn_begin().
      
      Introduce box_out interface, used to
      send box results to the client. Lua uses
      this interface to intercept returned tuples
      and push as return values to Lua stack.
      
      Make iov_add/iov_dup inline, as they used
      to be. They are now mostly used from within
      callbacks.
      
      Make txn_commit()/txn_rollback() non-static
      as they are now used in memcached.m.
      
      Introduce memcached_get(): implementation
      of Memcached GET statement. Wrap memcached_get()
      in proper txn_begin()/txn_commit()/txn_rollback(),
      and handle failure of memcached_get() by
      rolling back the transaction.
      Split BOX_QUIET to two flags: BOX_GC_TXN and
      BOX_QUIET.
      BOX_QUIET had a side-effect that txn_cleanup()
      was done immediately, rather than by fiber_gc().
      This had the side effect that txn_commit() could
      not be used in memcached_get(), because in
      memcached_get() we need both BOX_QUIET and txn_cleanup()
      called from fiber_gc().
      
      Now that we have box_out interface, eliminate
      BOX_QUIET flag completely, and use box_out_quiet
      set of callbacks instead.
      ccd61773
  21. Aug 16, 2011
    • Konstantin Osipov's avatar
      Refactoring box-tuple: review fixes. · 9495e5f9
      Konstantin Osipov authored
      Spell check the comments.
      Remove unnecessary changes. Be strict about
      not including more than necessary.
      Update copyright headers.
      Do not put static functions after non-static:
      a function can become non-static in future,
      and it should not require moving it around in
      the .m file.
      9495e5f9
    • Konstantin Osipov's avatar
      Move all iov functions to a common prefix (iov_). · 828eed51
      Konstantin Osipov authored
      Rename all iov_ functions to use a common prefix.
      This is used in the patch which adds hides box output
      behind an interface, and allows results of
      box.process() to be returned directly into Lua.
      828eed51
  22. Aug 15, 2011
  23. Aug 13, 2011
    • Konstantin Osipov's avatar
      Fix a memory leak when remote address was allocated in eter_pool. · 0e118a4e
      Konstantin Osipov authored
      Fix a memory leak when remote address was allocated
      in etet_pool (eternal memory pool) in recovery_follow_remote
      (start of replication).
      
      Remove fiber->data, as redundant and confusing.
      fiber->f_data is sufficient for all possible needs.
      
      Fix a bug when fiber_server::data was never initialized
      but passed to "on_bind" callback of fiber_server
      (this worked since no single "on_bind" callback uses
      its "data" argument).
      0e118a4e
  24. Aug 04, 2011
  25. Jul 27, 2011
    • Konstantin Osipov's avatar
      Lua: add CALL command to the binary protocol. · 25be21ff
      Konstantin Osipov authored
      CALL accepts flags and a tuple (list of fields).
      
      Add CALL support to the sql.g parser (Python
      testing environment).
      
      Add two new error codes: ER_PROC_LUA (an
      error inside Lua procedure) and ER_NO_SUCH_PROC.
      
      Since so far there is no way to create a stored
      procedure (one needs to rebuild Tarantool to pre-load it),
      this addition has little practical use.
      25be21ff
  26. Jul 26, 2011
    • Konstantin Osipov's avatar
      Lua: start adding support for box.* methods. · 9557019d
      Konstantin Osipov authored
      Add tuple print-out in yaml format, to be able to
      print Lua procedures output in the administrative console.
      
      Add box.process() function, the main callback into
      box from Lua. It takes a binary packet and passes it
      on to box for execution. The results of execution
      are added to fiber iov vector, so we can always
      just grab them and print out, which we do in the
      administrative console.
      9557019d
  27. Jul 25, 2011
    • Konstantin Osipov's avatar
      Lua: code review. Add rudimentary Lua support. · 70f14ca3
      Konstantin Osipov authored
      Implement rudimentary Lua support in the administrative console.
      Remove exec module command, it's not used and we now
      have Lua for similar purposes.
      
      Add a first Lua module, "box", which
      has only one function -- "pack", and test it.
      'pack' is derived from box.tbuf module in the
      original Lua patch.
      
      Fix a bug in box-protocol.txt, tuple format
      description.
      
      Add a copyright header to include/errcode.h (unrelated).
      
      Implement a prototype for Lua initialization
      procedure: there is a function tarantool_lua_init(),
      which any code, core or modules, can call.
      tarantool_lua_init() calls mod_lua_init() to
      add module-specific Lua extentions.
      
      Fix a bug in mod/CMakeLists.txt, generate_admin_c
      CMake target didn't exist, so admin.m wasn't
      re-generated correctly when admin.rl was changed.
      70f14ca3
  28. Jul 24, 2011
    • Konstantin Osipov's avatar
      A pre-requisite patch for Lua stored procedures: fiber->pool. · d6965dc0
      Konstantin Osipov authored
      A pre-requisite patch for Lua stored procedures:
      
      in some cases, it would be nice to create a Lua context
      in connection and destroy it when a connection ends.
      
      Unfortunately, right now fiber connections are stateless:
      there is on fiber constructor, destructor, or non-global fiber
      state.
      
      Change that by introducing fiber->pool, an allocation
      pool in which memory lives till a fiber is destroyed
      or becomes a zombie.
      
      We already have fiber->pool, which life cycle is different:
      it is created when a fiber starts, destroyed when a fiber
      ends, but also is garbage-collected once in a while.
      
      Rename this pool to fiber->gc_pool, to allow using
      name 'fiber->pool for something else.
      
      This patch only performs a rename and does nothing else.
      d6965dc0
  29. Jul 18, 2011
  30. Jul 12, 2011
    • Konstantin Osipov's avatar
      feature-feeder-in-core: review fixes · cc14fc85
      Konstantin Osipov authored
      Fix bugs in spawner child handling, performed at shutdown:
      - shutdown children more portably
      - remove races with lost SIGCHLD
      - do not self-terminate when doing kill(0, signal)
      (sending signal to entire process group).
      
      Clean up custom_proc_title handling and fiber names.
      cc14fc85
  31. Jul 11, 2011
Loading