Skip to content
Snippets Groups Projects
  1. Nov 26, 2021
  2. Nov 24, 2021
    • Igor Munkin's avatar
      luajit: bump new version · e8765ba5
      Igor Munkin authored
      * memprof: add info about trace start to symtab
      * memprof: group allocations on traces by traceno
      * memprof: refactor location parsing
      * test: separate memprof Lua API tests into subtests
      
      Closes #5814
      e8765ba5
    • Mergen Imeev's avatar
      sql: introduce field type MAP · 1364629e
      Mergen Imeev authored
      This patch introduces MAP to SQL. After this patch, all SQL operations
      and built-in functions should work correctly with MAP values. However,
      there is currently no way to create MAP values using only SQL tools.
      
      Part of #4763
      
      @TarantoolBot document
      Title: Field type MAP in SQL
      
      Properties of type MAP in SQL:
      1) a value of type MAP can be implicitly and explicitly cast only to
      ANY;
      2) only a value of type ANY with primitive type MAP can be explicitly
      cast to MAP;
      3) a value of any other type cannot be implicitly cast to MAP;
      4) a value of type MAP cannot participate in arithmetic, bitwise,
      comparison, and concatination operations.
      1364629e
    • Mergen Imeev's avatar
      sql: introduce field type ARRAY · e2102a15
      Mergen Imeev authored
      This patch introduces ARRAY to SQL. After this patch, all SQL operations
      and built-in functions should work correctly with ARRAY values. However,
      there is currently no way to create ARRAY values using only SQL tools.
      
      Part of #4762
      
      @TarantoolBot document
      Title: Field type ARRAY in SQL
      
      Properties of type ARRAY in SQL:
      1) a value of type ARRAY can be implicitly and explicitly cast only
         to ANY;
      2) only a value of type ANY with primitive type ARRAY can be explicitly
         cast to ARRAY;
      3) a value of any other type cannot be implicitly cast to ARRAY;
      4) a value of type ARRAY cannot participate in arithmetic, bitwise,
         comparison, and concatination operations.
      e2102a15
    • Mergen Imeev's avatar
      sql: introduce mem_snprintf() · 36668990
      Mergen Imeev authored
      This patch introduces the mem_snprintf() function, which writes the
      string representation of a MEM to buf.
      36668990
    • Mergen Imeev's avatar
      sql: omit quotes for UUID values in errors · 3cb98866
      Mergen Imeev authored
      This patch removes quotes from the representation of UUID values in the
      error description. This is because UUID values are printed without
      quotes elsewhere.
      3cb98866
    • Vladimir Davydov's avatar
      ci: run full ci only on PRs with 'full-ci' label · 6c2e664e
      Vladimir Davydov authored
      After this commit only three workflow are run on pull request or push to
      a developer branch:
       - luacheck
       - release
       - debug_coverage
      
      To run all other tests, one should either name the branch `*-full-ci`
      and push it to the main repository or set the 'full-ci' label on the
      pull request.
      
      It is also possible to disable all tests on push by naming branch as
      `*-notest' or setting the 'notest' label on the pull request.
      
      **Caveats**:
       - Unfortunately, currently it doesn't seem to be possible to run
         workflows automatically when a particular label is set - the best we
         can do is run workflows when *any* label is set. So labeling a PR
         that has the 'full-ci' label set will trigger all workflows!
       - For the same reason, removing the 'notest' label doesn't trigger ci.
         One has to synchronize the PR afterwards. We could trigger ci on the
         'unlabel' event, but this would trigger tests when any label is
         removed, not necessarily 'notest'. Since 'notest' is supposed to be
         used only by developers, who can sync the branch, this should be
         acceptable.
      
      While we are at it:
       - Remove the check disabling certain workflow runs on forks - it's
         pointless, because forks don't have ci. Anyway, we don't bother
         disabling most of our workflows on forks, even those that we run on
         self-hosted machines, so that would only be consistent.
       - Remove the condition from the coverity workflow - coverity doesn't
         run on push or PR so it doesn't make any sense.
       - Remove the condition from the 'source' workflow. Instead trigger it
         only when a tag is pushed. This is needed to avoid showing it as a
         skipped workflow in PRs and commits.
      
      Closes #6605
      6c2e664e
    • Vladimir Davydov's avatar
      net.box: rewrite state machine (transport) in C · c13b3a31
      Vladimir Davydov authored
      Line-by-line (mostly) migration of the net.box state machine
      implementation from Lua to C. The C implementation uses the iostream
      abstration, which will allow us to to easily support complex network
      protocols under IPROTO in future.
      
      Closes #6291
      c13b3a31
    • Vladimir Davydov's avatar
      coio/socket: use same ai_flags in coio_connect and tcp_connect/server · 75364a71
      Vladimir Davydov authored
      Currently,
      
       - socket.tcp_server sets AI_PASSIVE.
       - socket.tcp_connect sets no flags, but passes 'tcp' for protocol.
       - coio_connect sets AI_ADDRCONFIG|AI_PASSIVE|AI_NUMERICSERV.
       - evio_service sets AI_ADDRCONFIG|AI_PASSIVE.
      
      This leads to different getaddrinfo results on some platforms (freebsd)
      and, as a result, test breakages (net.box_connect_timeout_gh-2054) after
      we switch net.box from socket.tcp_connect to coio_connect.
      
      Let's use compatible flags:
       - AI_ADDRCONFIG for clients (coio_connect and tcp_connect).
         (AI_PASSIVE doesn't make sense for connect.)
         (AI_NUMERICSERV isn't really needed in our case.)
       - AI_ADDRCONFIG|AI_PASSIVE for servers (evio_service, tcp_server).
      
      Let's also set ai_protocol to 'tcp' in both tcp_connect and tcp_server
      for consistency, because both these functions are only supposed to work
      with the tcp protocol, judging by their names.
      75364a71
    • Vladimir Davydov's avatar
      test: don't use net.box perform_request in tests · ae522950
      Vladimir Davydov authored
      It's too low-level. Use conn:_request instead.
      
      While we are at it, let's explicitly check the error in
      net.box_long-poll_input_gh-3400.test.lua to make it more
      robust.
      ae522950
    • Vladimir Davydov's avatar
      net.box: refactor netbox_communicate to be iostream-friendly · d50e80e3
      Vladimir Davydov authored
      We will use iostream in net.box when we convert the state machine to C.
      Rework netbox_communicate() so that it's easy to migrate to iostream.
      d50e80e3
    • Vladimir Davydov's avatar
      net.box: never omit password in netbox_encode_auth · bc03a2c7
      Vladimir Davydov authored
      xrow_decode_auth() expects the password to be set so omitting it while
      preparing a request is incorrect. Net.box state machine (in Lua) sets
      the password to an empty string if it's nil so the code handling NULL
      password in netbox_encode_auth() is actually dead. Let's remove it.
      bc03a2c7
    • Vladimir Davydov's avatar
      net.box: keep strong reference to callback in connection object · 1ab6d80d
      Vladimir Davydov authored
      The callback passed to the worker fiber (in create_transport())
      references the connection object. Since a fiber is a GC root, it means
      that the worker fiber pins the connection object. To avoid this, we use
      a weak callback reference. To prevent the callback from being GC-ed
      prematurely, we need to store a strong reference to it somewhere.
      Currently, we have some GC magic in create_transport(): we store a
      strong reference to the callback in the bound parameters of
      transport.stop(). This works fine, but when we migrate the transport
      implementation to C, we won't be able to override transport.stop() so
      let's store a strong reference in the connection object instead.
      
      While we are at it, let's drop create_transport method from net.box
      module exports, because it's not used anywhere in Tarantool code or
      tests, neither is it documented.
      1ab6d80d
    • Vladimir Davydov's avatar
      net.box: fix yield in connection GC callback · ce867aaa
      Vladimir Davydov authored
      A GC callback must not yield.
      
      Fixes commit 72adeda6 ("net.box:
      implement connection closing without dropping requests");
      
      Closes #6617
      ce867aaa
    • Vladimir Davydov's avatar
      net.box: raise if on_event callback failed · 4978f474
      Vladimir Davydov authored
      The callback isn't supposed to normally raise exceptions (it runs client
      code in pcall). If something abnormal happens, like a memory allocation
      error, better break the loop and stop the state machine.
      
      Also, raise an exception if we failed to decode an IPROTO_EVENT packet -
      this means that something is wrong with the other end and we better stop
      the connection (this is what we do if we fail to decode other packets).
      4978f474
    • Vladimir Davydov's avatar
      net.box: pass all state machine errors in exception · ab2e085d
      Vladimir Davydov authored
      Currently, some errors raise exception (e.g. memory allocation, fiber is
      cancelled) while others are handled by the state machine code. Let's
      pass all errors in exceptions and drop error_sm. This simplifies the
      state machine code a little bit.
      ab2e085d
    • Vladimir Davydov's avatar
      net.box: drop transport.wait_state method · 69902512
      Vladimir Davydov authored
      We can implement it in Lua, because the transport invokes the callback
      whenever the state changes. This will simplify conversion of the state
      machine to C.
      69902512
    • Vladimir Davydov's avatar
      net.box: drop id callback · afbaa87a
      Vladimir Davydov authored
      Pass protocol version and features to handshake callback along with
      greeting. The fewer callbacks we have, the easiser it'll be to convert
      the code to C.
      
      While we are at it, add a missing comment for the event callback.
      afbaa87a
    • Vladimir Davydov's avatar
      net.box: pass reconnect_after and connect_timeout to sm explicitly · fa29e8fe
      Vladimir Davydov authored
      There's no point in using the callback for this. It'd only complicate
      moving the state machine to C.
      fa29e8fe
    • Vladimir Davydov's avatar
      net.box: drop will_fetch_schema callback · f379bd1e
      Vladimir Davydov authored
      Not used since console support was dropped. Drop it to simplify
      migration of the net.box state machine to C.
      
      @TarantoolBot document
      Title: Update the net.box state machine diagram
      
      New diagram from the net.box source code:
      
      ```
      initial -> auth -> fetch_schema <-> active
      
      (any state, on error) -> error_reconnect -> auth -> ...
                                               \
                                                -> error
      (any state, but 'error') -> closed
      ```
      f379bd1e
    • Vladimir Davydov's avatar
      net.box: drop console support · 68837841
      Vladimir Davydov authored
      net.box console support was deprecated more than three years ago, in
      commit bd06e32a ("netbox: deprecate
      console support"). Let's drop it, because it'll greatly simply rewriting
      the net.box state machine in C.
      
      @TarantoolBot document
      Title: Delete documentation entry for net.box console
      
      net.box console support, which was deprecated in 1.10, was dropped.
      Now, one has to use `require('console').connect(host, port)` instead
      of `require('net.box').connect(host, port, {console = true})`.
      68837841
    • Vladimir Davydov's avatar
      net.box: drop establish_connection and wrap methods · 1bc6fef2
      Vladimir Davydov authored
      establish_connection is used by console to check greeting: if the
      protocol is 'Binary', it wraps the connected socket in a net.box
      connection; if it's 'Lua console', it wraps the socket in a console
      handler.
      
      Presence of these methods complicates migration of the net.box state
      machine to C. Also, it'll be difficult to support establish_connection
      when we switch net.box to the iostream abstraction, because a greeting
      should be received via iostream, not fd, probably after some
      protocol-specific negoitiation (e.g. TLS), while iostream isn't (and
      won't be) available in Lua and so can't be easily passed around from
      establish_connection to Lua and then back to net.box state machine.
      
      Since Lua console will always use plain sockets (it doesn't require
      encryption as it's supposed to run on the local host), let's first try
      to establish a net.box connection and if it fails because of unsupported
      protocol, try to establish a Lua console connection. It means that the
      socket will be connected twice for Lua console, which is suboptimal, but
      it should be fine, because it's not a hot path.
      1bc6fef2
  3. Nov 23, 2021
  4. Nov 22, 2021
    • Oleg Babin's avatar
      util: fix bloom test build on MacOS · 11e87877
      Oleg Babin authored
      Before this patch test build failed with following error:
      ```
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/memory:2666:26: error: unexpected type name '_CompressedPair': expected expression
          struct _ALIGNAS_TYPE(_CompressedPair) _Storage {
      ```
      
      This patch seems to be fix this issue.
      The root of the problem is in "trivia/util.h" module. It defines
      alignas macros: `#define alignas(_n)
      __attribute__((aligned(_n)))`. And it seems causes some issues in
      stdlib internals. To fix this issue let's unconditionally include
      stdalign.h for C++. According [1] this header should internally
      define __alignas_is_defined macro.
      
      [1] https://en.cppreference.com/w/cpp/language/alignas
      
      Part of #6576
      11e87877
    • Mergen Imeev's avatar
      sql: define default types for built-in functions · 14aa6a59
      Mergen Imeev authored
      After this patch, all functions that take arguments of one of two or
      more types have defined a default type, which is used when the argument
      type cannot be determined.
      
      Closes #6483
      
      @TarantoolBot document
      Title: Default types of SQL built-in functions
      
      In case a function takes an argument of one of two or more types, this
      function has defined the default type for this argument. This type is
      used when the type of the argument cannot be determined, for example, in
      the case of a bound variable.
      
      Rules for determining default types as follows:
      1) When there is only one possible type, it is default.
      2) When possible types are INTEGER, DOUBLE or DECIMAL, DECIMAL is
         default.
      3) When possible types are STRING or VARBINARY, STRING is default.
      4) When possible data types are any other scalar data type, SCALAR is
         default.
      5) Otherwise, there is no default type.
      14aa6a59
    • Mergen Imeev's avatar
      sql: introduce DECIMAL to SQL built-in functions · b30c84dd
      Mergen Imeev authored
      After this patch, all SQL built-in functions will work correctly with
      DECIMAL values.
      
      Closes #6355
      b30c84dd
    • Vladimir Davydov's avatar
      test: fix coio_connect return value check · ab1f80d1
      Vladimir Davydov authored
      coio_connect() returns a file descriptor so we need to
      fix the check from != 0 to < 0.
      
      Fixes commit ec937bee
      ("coio: check inet_pton result").
      
      Reported by Coverity.
      ab1f80d1
    • Serge Petrenko's avatar
      coio: handle spurious wakeup correctly · ef51e48d
      Serge Petrenko authored
      coio_accept, coio_read, coio_write, coio_writev used to handle spurious
      wakeups correctly: if the timeout hasn't passed yet, they would simply
      retry reading (or writing) and fall asleep once again if no data is
      ready.
      
      This behaviour changed in the following patches:
      577a640a ("coio: pass fd to
      coio_accept") and 4f84859d ("Introduce
      iostream wrapper for socket I/O").
      
      Now the functions timeout on the very first spurious wakeup.
      
      Fix this and add the appropriate unit tests.
      ef51e48d
  5. Nov 21, 2021
  6. Nov 19, 2021
    • Vladislav Shpilevoy's avatar
      test: fix flaky read_only_reason test · 5105c2d7
      Vladislav Shpilevoy authored
      The test sometimes failed the test cases
      test_read_only_reason_synchro_no_uuid and
      test_read_only_reason_election_has_leader_no_uuid.
      
      Both relied on an instance being gone from 'replicaset' global
      internal object in C once it is gone from _cluster. But it wasn't
      true.
      
      If an instance is not visible in _cluster, it could still be not
      deleted from 'replicaset' because it is done only on WAL write
      end. So this was a dirty read - the check about an id absent in
      _cluster.
      
      The more reliable way is to check that the replica is gone from
      box.info.replication - it is built from this 'replicaset' object.
      
      Closes #6621
      5105c2d7
  7. Nov 18, 2021
  8. Nov 17, 2021
    • mechanik20051988's avatar
      test: fix flaky net.box_tx_timeout.test · 76f3ea76
      mechanik20051988 authored
      The problem was that when we wanted to check that
      the transaction rolled back after the timeout, we
      called `fiber.sleep` on the local instance, while
      the timeout for transaction counted on the remote
      instance. Fix the text, so now we call `fiber.sleep`
      on remote server, ensuring that timeout for transaction
      expires.
      
      Closes #6586
      76f3ea76
    • mechanik20051988's avatar
      iproto: implement ability to open several listening sockets · 531e229e
      mechanik20051988 authored
      Previously, iproto could only open one socket for listening
      only. This patch change this behaviour, now user can open
      several listening sockets. Also in addition to ability to
      pass uri as a number or string, as  previously, ability to
      pass uri as a table of numbers or strings has been added.
      
      Closes #3554
      
      @TarantoolBot document
      Title: multiple iproto listen sockets
      Implement ability to open several listening sockets.
      Implement ability to pass several listening uri as a table
      of numbers or strings.
      ```lua
      box.cfg { listen = {3301, 3302, 3303} }
      box.cfg { listen = {"127.0.0.1:3301", "127.0.0.1:3302"} }
      ```
      531e229e
Loading