Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [Tarantool-patches] [PATCH v2 00/15] RFC: module api: extend for external key_def Lua module
Date: Sun, 11 Oct 2020 15:57:33 +0300	[thread overview]
Message-ID: <cover.1602420460.git.alexander.turenko@tarantool.org> (raw)

See cover letter for the v1 patchset ([1]) for the background
information.

The patchset still in progress, shared to collect feedback earlier.
Sorry for that, the deadline is very soon...

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-September/019583.html

Changelog from v1 to v2
-----------------------

- 1.10 patchset: polished description of 'lua: adjust contract of
  luaT_tuple_new()' commit.
- Restructured patches around luaT_tuple_encode() and luaT_tuple_new() in order
  to minimize diffs considering that I decided to fix #5382 ('luaT_tuple_new()
  raises a Lua error that leads to various problems') before exposing those
  functions.
- Fixed #5382: luaT_tuple_new() don't raise an error anymore (same for the
  luaT_tuple_encode()).
- Encode to the box region in luaT_tuple_encode().
- Added the preliminary commit 'lua: factor out tuple encoding from
  luaT_tuple_new' to simplify the changes above a bit.
- Changed prefix from 'refactoring' to 'module api' or 'module api/lua' in
  commits regarding API_EXPORT macro.
- Moved key_def_api.[ch] functions back to key_def.[ch] and group them instead.
- Removed the dangerous advice about box region ('data allocated on this region
  are freed eventually').
- Clarified when box_region_alloc() and box_region_aligned_alloc() should be
  used.
- Removed box_region_alloc_object() and box_region_alloc_array() macros from
  the module API.
- Fixed typos, ordering in src/exports.h, Doxygen comments style and so on.
- Removed MULTIKEY_NONE from the API.
- Dropped 'allow_nullable' parameter from key validation function.
- Added copying of collation name from <struct coll_id> in
  box_key_def_dump_parts().
- Renamed box_key_def_new_ex() to box_key_def_new_v2().
- Fixed OOM and zero parts count handling in box_key_def_new_v2().
- Dropped BOX_KEY_PART_DEF_IS_NULLABLE_SHIFT, cut _MASK from
  BOX_KEY_PART_DEF_IS_NULLABLE_MASK.
- Renamed box_tuple_extract_key_ex() to box_key_def_extract_key().
- Renamed box_tuple_validate_key_parts() to box_key_def_validate_tuple().
- Added a note for box_region_align_alloc() that alignment must be a power of
  2.
- Added a basic box region test.
- Added a luaL_iscdata() test.
- Added a basic luaT_tuple_new() test.
- Clarified box_key_part_def_create() guarantees.
- Added basic tests for box_key_part_def_create() and box_key_def_new_v2().
- Added test for box_key_def_dump_parts().
- Added basic test for test_key_def_validate_tuple().

Plan for v3
-----------

- Write basic test cases.
  - box_key_def_merge()
  - box_key_def_extract_key()
  - box_key_def_validate_key()
- Try to simplify commits that introduces luaT_tuple_encode().
- Add @ChangeLog.
- Polish something like order of functions and so on if time will
  permit.

Looks like I have the evening and the night for that. Challenge
accepted.

Issues
------

https://github.com/tarantool/tarantool/issues/5313 ('module api: module
API requires C11')
https://github.com/tarantool/tarantool/issues/5273 ('module api: expose
everything that is needed for external key_def module')

Branches
--------

https://github.com/tarantool/tarantool/tree/Totktonada/gh-5273-expand-module-api
(top 15 commits)
https://github.com/tarantool/tarantool/tree/Totktonada/gh-5273-expand-module-api-1.10
(outdated now, will update a bit later)

Alexander Turenko (15):
  module api: get rid of typedef redefinitions
  module api: expose box region
  module api/lua: add luaL_iscdata() function
  lua: factor out tuple encoding from luaT_tuple_new
  lua: don't raise a Lua error from luaT_tuple_new()
  WIP: module api/lua: add luaT_tuple_encode()
  module api/lua: expose luaT_tuple_new()
  module api/lua: add API_EXPORT to tuple functions
  module api: add API_EXPORT to key_def functions
  module api: add box_key_def_new_v2()
  module api: add box_key_def_dump_parts()
  module api: expose box_key_def_validate_tuple()
  WIP: module api: expose box_key_def_merge()
  WIP: module api: expose box_key_def_extract_key()
  WIP: module api: add box_key_def_validate_key()

 src/CMakeLists.txt               |   2 +-
 src/box/index.h                  |   5 +-
 src/box/key_def.c                | 251 +++++++++++
 src/box/key_def.h                | 226 +++++++++-
 src/box/lua/tuple.c              | 204 +++++++--
 src/box/lua/tuple.h              |  46 +-
 src/exports.h                    |  14 +
 src/lib/core/fiber.c             |  24 ++
 src/lib/core/fiber.h             |  76 ++++
 src/lua/utils.c                  |   6 +
 src/lua/utils.h                  |  20 +
 test/app-tap/CMakeLists.txt      |   6 +
 test/app-tap/module_api.c        | 713 +++++++++++++++++++++++++++++++
 test/app-tap/module_api.test.lua |  58 ++-
 test/unit/luaT_tuple_new.c       |  42 +-
 test/unit/luaT_tuple_new.result  |   6 +-
 16 files changed, 1639 insertions(+), 60 deletions(-)

-- 
2.25.0

             reply	other threads:[~2020-10-11 12:57 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 12:57 Alexander Turenko [this message]
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 01/15] module api: get rid of typedef redefinitions Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 02/15] module api: expose box region Alexander Turenko
2020-10-11 15:26   ` Vladislav Shpilevoy
2020-10-12  6:07     ` Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 03/15] module api/lua: add luaL_iscdata() function Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 04/15] lua: factor out tuple encoding from luaT_tuple_new Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 05/15] lua: don't raise a Lua error from luaT_tuple_new() Alexander Turenko
2020-10-11 15:25   ` Vladislav Shpilevoy
2020-10-12 10:37     ` Alexander Turenko
2020-10-12 13:34       ` Timur Safin
2020-10-14 23:41       ` Vladislav Shpilevoy
2020-10-15 19:43         ` Alexander Turenko
2020-10-15 22:10           ` Vladislav Shpilevoy
2020-10-11 17:47   ` Igor Munkin
2020-10-11 18:08     ` Igor Munkin
2020-10-12 10:37     ` Alexander Turenko
2020-10-12 10:51       ` Igor Munkin
2020-10-12 18:41         ` Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 06/15] WIP: module api/lua: add luaT_tuple_encode() Alexander Turenko
2020-10-11 15:25   ` Vladislav Shpilevoy
2020-10-12 10:35     ` Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 07/15] module api/lua: expose luaT_tuple_new() Alexander Turenko
2020-10-11 15:25   ` Vladislav Shpilevoy
2020-10-12  6:11     ` Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 08/15] module api/lua: add API_EXPORT to tuple functions Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 09/15] module api: add API_EXPORT to key_def functions Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 10/15] module api: add box_key_def_new_v2() Alexander Turenko
2020-10-11 15:25   ` Vladislav Shpilevoy
2020-10-12  7:21     ` Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 11/15] module api: add box_key_def_dump_parts() Alexander Turenko
2020-10-11 15:25   ` Vladislav Shpilevoy
2020-10-12  6:50     ` Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 12/15] module api: expose box_key_def_validate_tuple() Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 13/15] WIP: module api: expose box_key_def_merge() Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 14/15] WIP: module api: expose box_key_def_extract_key() Alexander Turenko
2020-10-11 12:57 ` [Tarantool-patches] [PATCH v2 15/15] WIP: module api: add box_key_def_validate_key() Alexander Turenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1602420460.git.alexander.turenko@tarantool.org \
    --to=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 00/15] RFC: module api: extend for external key_def Lua module' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox