Skip to content
Snippets Groups Projects
  1. Dec 08, 2022
  2. Dec 07, 2022
    • Georgiy Lebedev's avatar
      box: export current session's identifier to C API · 9b0a767d
      Georgiy Lebedev authored
      In order to send IPROTO packets using `box_iproto_send` (#7897) we need to
      have some session identifier source in the C API: for now, export an analog
      of `box.session.id`.
      
      Closes #7895
      
      @TarantoolBot document
      Title: Document export of current session's identifier to C API
      For the API description and usage examples, see:
      * [design document](https://www.notion.so/tarantool/box-iproto-override-44935a6ac7e04fb5a2c81ca713ed1bce#0900ff9cb6b148378ce0b185d3f628b9);
      * tarantool/tarantool#7895.
      9b0a767d
    • Vladimir Davydov's avatar
      box: don't stop parsing authentication request if user doesn't exist · 42badb87
      Vladimir Davydov authored
      Currently, we stop without checking the authentication request body if
      the specified user doesn't exist. As a result, one can check if a user
      exists by sending a malformed authentication request: for an existing
      user, the server will reply with ER_INVALID_MSGPACK error while if the
      user doesn't exist, the error will be set to ER_CREDS_MISMATCH. To fix
      this, let's parse the authentication request body even if the user
      doesn't exist.
      
      Closes https://github.com/tarantool/security/issues/21
      
      NO_DOC=bug fix
      42badb87
    • Vladimir Davydov's avatar
      box: run box.session.on_auth triggers if the user doesn't exist · 8a2f1653
      Vladimir Davydov authored
      The triggers are supposed to run on any authentication attempt,
      successful or not. Without it, the admin may not notice a malefactor
      enumerating user names.
      
      Closes #8017
      
      NO_DOC=bug fix
      8a2f1653
    • Vladimir Davydov's avatar
      box: drop redundant guest password checks from authenticate · 26f69561
      Vladimir Davydov authored
      The guest can't have a non-empty password - it's explicitly prevented by
      the _user trigger callback:
      
      https://github.com/tarantool/tarantool/blob/2ed06651c317f2d46631b0d55e4b88f2c8a6c0a0/src/box/alter.cc#L2930-L2936
      
      So there's no need to check the guest user password in authenticate.
      
      NO_DOC=code cleanup
      NO_TEST=code cleanup
      NO_CHANGELOG=code cleanup
      26f69561
    • Ilya Verbin's avatar
      log: improve logging of tables · 85ef1118
      Ilya Verbin authored
      1. Fixed modification of a variable passed to the logging function
         (both log formats)
      
         tarantool> a = {foo = 'bar', file = 'c://autorun.bat'}
         tarantool> log.info(a)
         [...]
         tarantool> a
         (before) - foo: bar
          (after) - foo: bar
                    file: c://autorun.bat
      
      2. Fixed the drop of fields with reserved internal names (plain log format)
      
         tarantool> log.info({foo = 'bar', pid = 666})
         (before) {"foo":"bar"}
          (after) {"foo":"bar","pid":666}
      
      3. Now if 'message' field is absent, it is set to the first field of the
         table (JSON log format)
      
         tarantool> log.info({'Hello, world', key = 'value'})
         (before) {[...], "1":"Hello, world", "key":"value", [...]}
          (after) {[...], "message":"Hello, world", "key":"value", [...]}
      
      4. Fixed assertion on a table without string keys (JSON log format)
      
         If a Lua table, passed to say(), contains only integer indexes,
         json.encode() will encode it as an array rather than a map, thereafter
         say_format_json() will produce improperly formatted JSON string, or get
         assertion failure. Fix it by encoding all kinds of tables as maps.
      
      Closes #3853
      Closes #7955
      
      NO_DOC=Mostly bug fixes, the format of the JSON log is not documented.
      85ef1118
    • Ilya Verbin's avatar
      test: fix flaky gh_6539_log_user_space_empty_or_nil_select_test · 84306671
      Ilya Verbin authored
      Turn LuaJIT off for this test on AArch64 in the scope of the issue [1].
      
      Also increase grep_log_bytes. Currently the message is 235 byte long,
      which is pretty close to 256. If one more item is added to the traceback,
      the test will fail.
      
      ```
      C> Potentially long select from space 'test_memtx' (512)
       stack traceback:
              builtin/box/schema.lua:2528: in function 'check_select_safety'
              builtin/box/schema.lua:2545: in function 'select'
              eval:1: in main chunk
              [C]: at 0x556e8ffd5c
      ```
      
      [1] Related to #8011
      Closes tarantool/tarantool-qa#264
      
      NO_DOC=test fix
      NO_CHANGELOG=test fix
      84306671
    • Igor Munkin's avatar
      cmake: enable LUAJIT_ENABLE_CHECKHOOK option · 7a82d74c
      Igor Munkin authored
      
      In the scope of this commit check for instruction/line hooks for
      compiled code is turned on. As a result a special pad is emitted to the
      trace validating whether any debug hook is fired while this trace is
      being executed.
      
      Closes #7762
      
      NO_DOC=internal
      
      Reviewed-by: default avatarSergey Kaplun <skaplun@tarantool.org>
      Reviewed-by: default avatarMaxim Kokryashkin <m.kokryashkin@tarantool.org>
      Signed-off-by: default avatarIgor Munkin <imun@tarantool.org>
      7a82d74c
    • Igor Munkin's avatar
      luajit: bump new version · 91ffae2a
      Igor Munkin authored
      * Fix narrowing of unary minus.
      * Don't compile math.modf() anymore.
      * OSX/ARM64: Fix external unwinding.
      * Fix build with busybox grep.
      * BSD: Fix build with BSD grep.
      * OSX/ARM64: Disable unwind info.
      * ARM64: Reorder interpreter stack frame and fix unwinding.
      * OSX/ARM64: Disable external unwinding for now.
      * OSX: Fix build by hardcoding external frame unwinding.
      * Cleanup and enable external unwinding for more platforms.
      * test: remove TAP side effects in getmetrics tests
      * test: relax JIT setup in misc.getmetrics test
      * test: relax JIT setup in lj-430-maxirconst test
      * GC64: enable sysprof support
      
      Closes #6096
      Closes #6976
      Closes #7919
      Relates to #781
      Relates to #7762
      Part of #7230
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      91ffae2a
  3. Dec 06, 2022
  4. Dec 05, 2022
    • Yaroslav Lobankov's avatar
      test: use luatest modules instead of internal ones · 21fc0770
      Yaroslav Lobankov authored
      Some internal modules have been recently copied to luatest repo [1,2]
      and now they can be safely removed, and the corresponding functionality
      from luatest can be used instead.
      
      Affected modules:
      
      - test/luatest_helpers/server.lua
      
      [1] tarantool/luatest#258
      [2] tarantool/luatest#266
      
      Closes tarantool/luatest#239
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      21fc0770
    • Yaroslav Lobankov's avatar
      test: bump test-run to version w/ updated luatest · 9687656f
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
      - Bump luatest to 0.5.7-17-g1387aa8 [1]
      
      [1] tarantool/test-run#360
      
      Part of tarantool/luatest#239
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      9687656f
    • Nikolay Shirokovskiy's avatar
      libunwind: use latest release v1.6.2 as a base · 5b08d71a
      Nikolay Shirokovskiy authored
      Now we base on some unreleased state of libunwind. This is by itself not
      a good practice. Yet the main motivation is that in the current version of
      libunwind fast path for backtrace detection on x86_64 does not work.
      I guess this is because of libunwind/libunwind@400b3f819ad4 (" x86_64: Stop
      aliasing RSP and CFA"). See libunwind/libunwind#440. Fortunately this
      commit is not present it the latest release.
      
      Using fast or slow path has a great impact on performance of debug build
      where collecting fiber gc allocation backtrace is turned on by default.
      It surely depends on frequency and pattern of allocation. Test
      sql/delete3 depends on backtrace performance most dramatically. On some
      installations collecting backtraces slowed down the test up to 10 times.
      
      If fast path is available then collecting backtrace does not affect
      performance in a noticeable way.
      
      I propose not to keep autotools products in the libunwind fork repo as
      it is done previously. LOG_CONFIGURE is removed because it somehow
      incompatible with using && in CONFIGURE_COMMAND command and not critical
      to the build.
      
      Also add autotools build dependencies for packpack package specs.
      Currently not all packpack images have autotools preinstalled so this is
      required for build to success. Anyway we'b better have precise build
      requirements in build specs.
      
      Follow-up #5665
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      5b08d71a
    • Ilya Verbin's avatar
      cmake: fix wrong CPU architecture reported on M1/M2 Macs · d76be7ef
      Ilya Verbin authored
      This patch removes an old CMake kludge, which sets CMAKE_SYSTEM_PROCESSOR
      to "x86_64" on all 64-bit architectures, even on ARM (on Darwin).
      
      Closes #7495
      
      NO_DOC=bugfix
      d76be7ef
  5. Dec 02, 2022
    • Ilya Verbin's avatar
      backtrace: update sp before saving registers to a stack frame · 9adc4aa7
      Ilya Verbin authored
      backtrace_collect() is suffering from the same issue as coro_transfer(),
      see commit 215630e6 ("coro: update sp before saving registers to a
      stack frame").
      
      It stores x19-x30 and d8-d15 registers to the stack, but only after that
      it updates the stack pointer. If a SIGALRM signal is delivered during
      the execution of backtrace_collect, the signal handler will use the
      stack starting from current sp, thus corrupting the saved registers.
      
      Fix this by updating the stack pointer at the beginning of
      backtrace_collect. The constraint of the input operand `bt` is changed
      from "m" to "r" to force `bt` always be passed to the inline assembly
      via the register. Passing on stack will not work after this fix.
      
      Closes #7985
      
      NO_DOC=bugfix
      NO_TEST=Hard to create a stable reproducer
      9adc4aa7
  6. Nov 30, 2022
    • Georgiy Lebedev's avatar
      memtx: fix logic of read tracker rebinding during rollback · 559b27db
      Georgiy Lebedev authored
      During rollback read trackers are rebound to newer or older story, if
      present. The problem with the current logic is that read trackers are
      basically rebound in the first available index: all information about key
      parts read from other indexes gets lost — rebind read trackers in all
      indexes.
      
      Closes #7828
      
      NO_DOC=bugfix
      559b27db
    • Georgiy Lebedev's avatar
      memtx: fix use-after-free of successor in `tree_iterator_start` · 651535bc
      Georgiy Lebedev authored
      We assumed that the successor tuple's story could not get garbage collected
      on clarify of result tuple in `tree_iterator_start`, since they coincide in
      case of regular iterators. But this is not the case for reverse iterators:
      the result tuple is of-by-one from the successor, which means the
      successor's story can get garbage collected along with the tuple itself
      getting deleted, leading to use-after-free of successor: remove garbage
      collection from `memtx_tx_tuple_clarify` and call it manually.
      
      The crash in #7756 revealed that the `put` in transaction manager's story
      hash table was performed incorrectly: fix it and add an assertion that
      nothing was replaced.
      
      Closes #7755
      Closes #7756
      
      NO_DOC=bugfix
      651535bc
  7. Nov 29, 2022
    • Mergen Imeev's avatar
      sql: convert SQL constraints to core constraints · 93067481
      Mergen Imeev authored
      This patch converts existing SQL foreign key constraints and check
      constraints into core foreign key constraints and check constraints.
      
      Closes #6986
      
      @TarantoolBot document
      Title: SQL constraints
      
      SQL constraints will now use the tuple constraint mechanism instead of
      the original SQL mechanism. This allows to set constraints that are
      independent of the language used for creation. However, this disables
      some SQL constraint features that are not supported by tuple
      constraints.
      93067481
    • Mergen Imeev's avatar
      sql: introduce core CHECK constraint to SQL · 0b17808a
      Mergen Imeev authored
      This patch forces SQL to create core CHECK constraint instead of SQL
      CHECK constraint.
      
      Part of #6986
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      0b17808a
    • Mergen Imeev's avatar
      box: introduce SQL_EXPR to field constraints · 1e099019
      Mergen Imeev authored
      After this patch, it will be possible to use the SQL_EXPR functions not
      only for tuple constraints, but also for field constraints.
      
      Needed for #6986
      
      @TarantoolBot document
      Title: SQL_EXPR functions
      
      Now it is possible to create functions with `SQL_EXPR` language. The
      `body` field of the function definition is the SQL expression.
      Currently, these functions can only be used as constraints on tuples and
      fields, as there is no interface to define argument names and types
      otherwise.
      
      If the SQL_EXPR function is set as a constraint on a field, the function
      will throw a validation error if more than one variable is used in the
      function. However, the variable name of the only variable will only be
      checked if the SQL_EXPR function was created as a field constraint from
      SQL.
      1e099019
    • Mergen Imeev's avatar
      box: do not expire SQL_EXPR functions · b54c8b3b
      Mergen Imeev authored
      SQL_EXPR functions use the mechanics of prepared statements, so they can
      expire after a schema change. However, since subselects are prohibited
      in these functions, there is no point in expiring them. This patch makes
      it so that SQL_EXPR functions no longer expire.
      
      Part of #6986
      
      NO_DOC=Bug
      NO_CHANGELOG=Bug in new functionality
      b54c8b3b
    • Mergen Imeev's avatar
      sql: correctly count named fields in SQL_EXPR · bc508c54
      Mergen Imeev authored
      Prior to this patch, if the last fields were nullable in tuple format,
      they were discarded in SQL_EXPR functions. Now they are counted
      correctly.
      
      Part of #6986
      
      NO_DOC=New feature
      NO_CHANGELOG=New feature
      bc508c54
    • Mergen Imeev's avatar
      sql: introduce core foreign keys to SQL · f5afbbcf
      Mergen Imeev authored
      This patch forces SQL to create core foreign keys instead of SQL foreign
      keys in SQL.
      
      Part of #6986
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      f5afbbcf
    • Mergen Imeev's avatar
      box: drop sql_defer_foreign_keys session setting · 14618c42
      Mergen Imeev authored
      This patch removes sql_defer_foreign_keys from the _session_setting
      system space, since foreign keys can no longer be deferred.
      
      Part of #6986
      
      @TarantoolBot document
      Title: Deletion of "sql_defer_foreign_keys" session setting.
      
      Because "constraint check time" is no longer supported by foreign keys,
      the session setting "sql_defer_foreign_keys" has no meaning and is
      discarded.
      14618c42
    • Mergen Imeev's avatar
      sql: drop three parsing rules · 5ab45ba3
      Mergen Imeev authored
      This patch removes three rules in the parser.
      
      NO_CHANGELOG=will be added later
      
      @TarantoolBot document
      Title: Changes in parsing rules.
      
      Three rules related to foreign keys have been removed.
      
      The first is the "reference trigger action" rule, which determines the
      behavior when a referenced tuple is deleted. This rule has been dropped
      because the new foreign keys only support RESTRICT.
      
      The second is "constraint check time" rule, which determines when a
      foreign key constraint should be validated. This rule has been dropped
      because the new foreign keys only support INITIALLY IMMEDIATELY.
      
      The third is "match type" rule, which determines how inserted values are
      validated. This rule has been dropped because the new foreign keys only
      support FULL.
      5ab45ba3
    • Mergen Imeev's avatar
      sql: drop some foreign key tests · 2b763ec9
      Mergen Imeev authored
      This patch removes some foreign key tests due to changes in foreign key
      mechanics. Since the SQL foreign key will be replaced by the BOX foreign
      key, some functionality will be removed or changed, so most of these
      tests become meaningless. Also, most foreign key features now will be
      tested in BOX rather than SQL.
      
      Part of #6986
      
      NO_DOC=drop tests
      NO_TEST=drop tests
      NO_CHANGELOG=drop tests
      2b763ec9
    • Serge Petrenko's avatar
      box: introduce on_recovery_state triggers · 24341d56
      Serge Petrenko authored
      Introduce triggers which are run during various stages of box.cfg{}.
      See the docbot request below for more info.
      
      Part-of #5272
      Part-of #3159
      
      @TarantoolBot document
      Title: new triggers -- `box.ctl.on_recovery_state`
      
      `box.ctl.on_recovery_state` is a handle to register triggers that will
      be executed on different stages of recovery/initial configuration.
      A trigger registered this way is run on each of the supported recovery
      stages, and receives the stage name as a parameter. The possible stages
      are:
       - "snapshot_recovered": the node has recovered the snapshot file.
       - "wal_recovered": the node has recovered all the .xlog files.
       - "indexes_built": all the secondary indexes are usable. This event
         might come even before any actual data is recovered, meaning that the
         indexes will be available right with the first recovered tuple.
       - "synced": the node has synced with enough remote peers and has left
         orphan state.
      
      All these stages are passed during initial `box.cfg` call when recovering
      from .snap and .xlog files.
      
      When bootstrapping a fresh cluster with no data, all the instances in it
      will still execute triggers on the same stages for consistency.
      For example, "snapshot_recovered" and "wal_recovered" will
      be run once the node finishes cluster bootstrap or finishes joining to an
      existing cluster.
      
      Anyway, by the time the initial `box.cfg` call finishes, regardless of
      recovery or bootstrap, the triggers will be called with parameters
      "snapshot_recovery", "wal_recovered" and "indexes_built". The triggers
      on "synced" state might execute later, when the node leaves the orphan
      mode.
      
      Note, that you must set `box.ctl.on_recovery_state` triggers before the
      initial `box.cfg` call for them to take effect.
      Example:
      
      NO_WRAP
      ```
      Tarantool 2.11.0
      type 'help' for interactive help
      tarantool> log = require('log')
      ---
      ...
      
      tarantool> trigger_f = function(state) log.info('State "' .. state .. '" reached') end
      ---
      ...
      
      tarantool> box.ctl.on_recovery_state(trigger_f)
      ---
      - 'function: 0x0104662788'
      ...
      
      tarantool> box.cfg{}
      <stripped some messages>
      2022-11-15 13:21:43.149 [98398] main/103/interactive I> recovering from `./00000000000000000004.snap'
      2022-11-15 13:21:43.166 [98398] main/103/interactive I> cluster uuid 75c5c40e-c795-4c6f-b602-25fe5b1c9f3b
      2022-11-15 13:21:43.187 [98398] main/103/interactive I> assigned id 1 to replica 1fbcb1d7-f600-4cc6-83b4-8d409d2937a9
      2022-11-15 13:21:43.187 [98398] main/103/interactive I> update replication_synchro_quorum = 1
      2022-11-15 13:21:43.187 [98398] main/103/interactive I> State "snapshot_recovered" reached
                                                                     ^^^^^^^^^^^^^^^^^^
      2022-11-15 13:21:43.187 [98398] main/103/interactive I> recover from `./00000000000000000004.xlog'
      2022-11-15 13:21:43.188 [98398] main/103/interactive I> done `./00000000000000000004.xlog'
      2022-11-15 13:21:43.188 [98398] main/103/interactive I> recover from `./00000000000000000006.xlog'
      2022-11-15 13:21:43.188 [98398] main/103/interactive I> done `./00000000000000000006.xlog'
      2022-11-15 13:21:43.188 [98398] main/103/interactive I> Building secondary indexes in space 'test'...
      2022-11-15 13:21:43.188 [98398] main/103/interactive I> Adding 2 keys to TREE index 'sk' ...
      2022-11-15 13:21:43.188 [98398] main/103/interactive I> Space 'test': done
      2022-11-15 13:21:43.188 [98398] main/103/interactive I> State "indexes_built" reached
                                                                     ^^^^^^^^^^^^^
      2022-11-15 13:21:43.189 [98398] main/103/interactive I> State "wal_recovered" reached
                                                                     ^^^^^^^^^^^^^
      2022-11-15 13:21:43.189 [98398] main/103/interactive I> ready to accept requests
      2022-11-15 13:21:43.189 [98398] main/103/interactive I> State "synced" reached
                                                                     ^^^^^^
      2022-11-15 13:21:43.189 [98398] main/103/interactive I> leaving orphan mode
      <stripped some messages>
      ---
      ...
      
      tarantool>
      
      ```
      NO_WRAP
      24341d56
    • Serge Petrenko's avatar
      test: fix server:grep_log() finding server restarts · 5bef1125
      Serge Petrenko authored
      grep_log() was ported from test_run.lua and relied on string "Starting
      instance" being shown on instance restart. Luatest doesn't leave such
      messages in instance logs, so better rely on tarantool version output to
      detect instance restarts.
      
      In-scope-of #5272
      
      NO_DOC=testing
      NO_TEST=testing
      NO_CHANGELOG=testing
      5bef1125
    • Serge Petrenko's avatar
      test: allow to execute custom code before box.cfg in default instance · 560d9fdf
      Serge Petrenko authored
      Sometimes there's a need in creating a custom testing instance, with
      test-specific code, which doesn't fit in box.cfg.
      
      Our usual approach is to duplicate the instance file (default.lua) and make
      the necessary changes there. This leads to a lot of code duplication and
      lots of instance files with unclear use cases.
      
      Let's better make it possible to pass code to the default instance via
      an env variable TARANTOOL_RUN_BEFORE_CFG.
      
      This will be used in box.ctl.on_recovery_state() triggers test.
      
      In-scope-of #5272
      
      NO_DOC=testing
      NO_TEST=testing
      NO_CHANGELOG=testing
      560d9fdf
    • Andrey Saranchin's avatar
      replication: make before_replace work better with space _cluster · a470bb63
      Andrey Saranchin authored
      Firstly, there is an assertion that checks if replica_id haven't been
      changed after it's registration. Let's replace this assertion with warning
      message about id being altered - new id will be used for affected replica.
      
      Secondly, if before_replace trigger, set on space _cluster, returns nil,
      tarantool will crash with segmentation fault. This patch handles the case.
      
      Closes #7846
      
      NO_DOC=bugfix
      a470bb63
    • Georgiy Lebedev's avatar
      box: export IPROTO constants and features to Lua · fe89aabe
      Georgiy Lebedev authored
      Export IPROTO constants and features to Lua: for now, simply copy-paste all
      constants from `src/box/iproto_{constants, features}.h` — it would be nice
      to generate them in the future (#7103).
      
      Closes #7894
      
      @TarantoolBot document
      Title: export IPROTO constants and features to Lua
      or the API description and usage exmaples, see:
      * [design document](https://www.notion.so/tarantool/box-iproto-override-44935a6ac7e04fb5a2c81ca713ed1bce#dcaf854d2a9f4743ae25661c16528523);
      * tarantool/tarantool#7894.
      fe89aabe
  8. Nov 28, 2022
    • Andrey Saranchin's avatar
      misc: add changelog and doc request for pagination · d4a4a74e
      Andrey Saranchin authored
      Closes #7639
      
      @TarantoolBot document
      Title: Pagination
      
      Introduce pagination to memtx and vinyl trees. It allows to start iteration
      after last previously selected tuple. Since tuples can be huge in size,
      there is a new entity called `position` - opaque object that represents
      position of tuple in index. It is encoded to base64 format and can be
      transferred and stored without any issues with non-printable characters.
      
      Lua API of pagination:
      - `select`
      Select is provided with two new options: `fetch_pos` and `after`.
      Option `after` can take tuple (or table, representing it) or
      `position`. If it is passed, iteration will begin after tuple which
      is described by the option. If there is no tuple described by `after` in
      index, iteration starts with a tuple that would have been preceded by a
      described one. Empty string ("") or `box.NULL` can be passed as a start
      position. Here is an example:
      ```lua
      last_tuple = box.NULL
      while true do
          tuples = s:select(key, {limit=1000, after=last_tuple})
          if #tuples == 0 then
              break
          end
          last_tuple = tuples[#tuples]
          process_data(tuples)
      end
      ```
      
      The second option is `fetch_pos` - one can fetch a `position` of last
      selected tuple, it will be returned as the second value. If no tuples
      were fetched, `position` will be `nil`.
      The snippet can be simplified by using `fetch_pos` option:
      ```lua
      pos = ""
      while true do
          tuples, pos = s:select(key, {limit=1000, after=pos, fetch_pos=true})
          if pos == nil then
              break
          end
          process_data(tuples)
      end
      ```
      However, the benefits of using position are not only lower memory
      consumption and easier syntax - position is the only way to paginate
      over multikey and functional indexes - an error will be thrown when you
      use option `after` with tuple because tuple has not enough information
      to describe its position in such indexes.
      
      -`tuple_pos`
      Index has a new method `index:tuple_pos(tuple)`, it returns `position`
      of passed tuple (or a table, representing a tuple) in this index, even
      if there is no such tuple. Passed tuple must match format of the space.
      Does not work with multikey and functional indexes - an error will be
      thrown.
      ```lua
      pos = ""
      while true do
          tuples = s:select(key, {limit=1000, after=pos})
          if #tuples == 0 then
              break
          end
          last_tuple = tuples[#tuples]
          pos = s.index.pk:tuple_pos(last_tuple)
          process_data(tuples)
      end
      ```
      
      -`pairs`
      Pairs is provided only with `after` option with the same semantics.
      
      ```lua
      for _, tuple in s:pairs(10, {after={10, 5}} do
          process_tuple(tuple)
      end
      ```
      
      -IPROTO
      IPROTO is provided with new keys:
      
      0x2e - IPROTO_AFTER_POSITION - start iteration after passed
      `position`. It has type MP_STR.
      
      0x2f - IPROTO_AFTER_TUPLE - start iteration after passed tuple.
      It has type MP_ARRAY.
      
      0x1f - IPROTO_FETCH_POSITION - send position of last fetched tuple
      in response. It has type MP_BOOL.
      
      0x35 - IPROTO_POSITION - `position`, sent in response if
      IPROTO_FETCH_POSITION is true. It has type MP_STR.
      
      To start iteration from the beginning, one can send empty MP_STR as
      IPROTO_AFTER_POSITION or send no `position` at all.
      
      IPROTO_VERSION is bumped, new feature `pagination` is added.
      
      -`net.box`
      Net box select is provided with the same options `after` and
      `fetch_pos`. It has the same behavior as in index select. The only
      difference is format of returned values:
      If option `buffer` is passed, the whole response is written to buffer,
      only number of written bytes is returned.
      If option `skip_header` is passed (if `skip_header` is passed, then
      `buffer` is necessarily passed too), only IPROTO_DATA (without header)
      is written in buffer, select returns number of bytes written as the
      first value and `position` of last selected tuple as the second one.
      If request is async and without buffer, then table with tuples is
      returned if `fetch_pos` is false or nil (old behavior) and table with
      table of tuples and `position` of last selected tuples is returned if
      `fetch_pos` is true.
      If no options, described above, are passed, then table with tuples is
      returned as the first value and new `position` as the second one if
      `fetch_pos` option is true.
      
      Synchronous API:
      ```lua
      pos = ""
      while true do
          tuples, pos = conn.space.s:select(key, {limit=1000, after=pos,
              fetch_pos=true})
          if pos == nil then
              break
          end
          process_data(tuples)
      end
      ```
      
      Asynchronous API:
      ```lua
      pos = ""
      while true do
          ret = conn.space.s:select(key, {limit=1000, after=pos,
              fetch_pos=true, is_async=true})
          tuples = ret[1]
          pos = ret[2]
          if pos == nil then
              break
          end
          process_data(tuples)
      end
      ```
      
      NO_TEST=no changes
      d4a4a74e
Loading