Skip to content
Snippets Groups Projects
  1. Mar 05, 2020
    • Serge Petrenko's avatar
      build: link bundled libcurl with c-ares · 254e42ce
      Serge Petrenko authored
      libcurl has a built-in threaded resolver used for asynchronous DNS
      requests, however, when DNS server is slow to respond, the request still
      hangs tarantool until it is finished. The reason is that curl calls
      thread_join on the resolving thread internally upon timeout, making the
      calling thread hang until resolution has ended.
      Use c-ares as an asynchronous resolver instead to eliminate the problem.
      
      Closes #4591
      
      (cherry picked from commit 23837076)
      254e42ce
  2. Aug 27, 2019
    • Max Melentiev's avatar
      Enable support for NOTIFY_SOCKET in envs without systemd · 0641cc7b
      Max Melentiev authored
      To make it possible to develop and test related features on
      systems without systemd.
      
      WITH_SYSTEMD cmake flag is used to generate systemd related files:
      unit, generator script, etc. To keep this behavior and make it possible
      to use NOTIFY_SOCKET without other systemd-related stuff,
      I added WITH_NOTIFY_SOCKET cmake flag.
      
      It also required some changes to support other OS:
      
      SOCK_CLOEXEC (not available on macOS) flag for socket()
      is replaced with `fcntl(fd, F_SETFD, FD_CLOEXEC)` which has the same effect.
      
      MSG_NOSIGNAL flag for sendmsg is also not available on macOS.
      However it has SO_NOSIGPIPE flag for setsockopt which disables SIGPIPE.
      So it requires different solution for different OS. Inspired by
      https://nwat.xyz/blog/2014/01/16/porting-msg_more-and-msg_nosigpipe-to-osx/
      
      Have to reduce send-buffer size to 4MB because larger values
      are not supported on macOS by default. This value should be enough
      for all systems because notification messages are usually less than 1KB.
      
      Fixes #4436
      
      (cherry picked from commit 1e509dde)
      0641cc7b
    • Alexander Turenko's avatar
      build: fix linking with static openssl library · b1b7fdf9
      Alexander Turenko authored
      System-wide dynamic libraries usually (always?) have NEEDED and RUNPATH
      tags in a dynamic section (as `readelf -d /usr/lib/lib<...>.so` shows),
      so when we link, say, with libssl.so, which depends on libz.so, a linker
      does not complain against unresolved symbols that can be found in Z
      library (if it is installed within a system).
      
      Things are different when we linking with a static library. Say, when we
      linking with libssl.a, which contains an unresolved symbol from Z
      library, a linker reports an error. It is not possible to store an
      information where to find unresolved symbols (NEEDED / RUNPATH) in a
      static library (AFAIK).
      
      We depend on three libraries that are depend on Z library: libcurl,
      libssl and libcrypto (two latter are part of OpenSSL). When one of those
      libraries is linked statically we should link with libz.so or libz.a
      (depending on BUILD_STATIC flag). The patch doing exactly this.
      
      The patch changes OPENSSL_LIBRARIES variable to fix the issue with
      static linking of OpenSSL libraries. It also changes CURL_LIBRARIES in
      the same way, however this does not alter any visible behaviour, because
      OPENSSL_LIBRARIES is added to CURL_LIBRARIES. The latter change was made
      to unify the way to choose libraries to link with: it is pure
      refactoring part.
      
      Fixes #4437.
      
      (cherry picked from commit 2cdfaf3b)
      b1b7fdf9
  3. Aug 21, 2019
    • Mergen Imeev's avatar
      build: link libcurl statically from a submodule · 5fcca9dd
      Mergen Imeev authored
      Hold libcurl-7.65.3. This version is not affected by the following
      issues:
      
      * #4180 ('httpc: redirects are broken with libcurl-7.30 and older');
      * #4389 ('libcurl memory leak');
      * #4397 ('HTTPS seem to be unstable').
      
      After this patch libcurl will be statically linked when
      ENABLE_BUNDLED_LIBCURL option is set. This option is set by default.
      
      Closes #4318
      
      @TarantoolBot document
      Title: Tarantool dependency list was changed
      
      * Added build dependencies: autoconf, automake, libtool, zlib-devel
        (zlib1g-dev on Debian).
      * Added runtime dependencies: zlib (zlib1g on Debian).
      * Removed build dependencies: libcurl-devel (libcurl4-openssl-dev on
        Debian).
      * Removed runtime dependencies: curl.
      
      The reason is that now we use compiled-in libcurl: so we don't depend on
      a system libcurl, but inherit its dependencies.
      
      (cherry picked from commit 7e51aebb)
      5fcca9dd
  4. Jun 13, 2019
    • Serge Petrenko's avatar
      lib/core: introduce decimal type to tarantool · 6d62c6c1
      Serge Petrenko authored
      Add fixed-point decimal type to tarantool core.
      Adapt decNumber floating-point decimal library for the purpose, write a
      small wrapper and add unit tests.
      
      A new decimal type is an alias for decNumber numbers from the decNumber
      library.
      Arithmetic operations (+, -, *, /) and some mathematic functions
      (ln, log10, exp, pow, sqrt) are available together with methods to
      pack and unpack decimal to and from its packed representation (useful
      for serialization).
      
      We introduce a single context for all the arithmetic operations
      on decimals, which enforces both number precision and scale to be
      in range [0, 38]. NaNs and Infinities are restricted.
      
      Part of #692
      6d62c6c1
  5. Mar 18, 2019
    • Cyrill Gorcunov's avatar
      lib/core/fiber: Relax stack memory usage on recycle · 553dc562
      Cyrill Gorcunov authored
      We want to detect a situation where task in fiber is too eager for
      stack memory and relax rss usage in such case. For this sake upon
      stack creation we put 8 marks near 64K bound (such params allows us
      to fill ~1/4 of a page, which seem reasonable but we might change
      this params with time).
      
      Once stack get recycled we investigate the marks and if they were
      overwritten we drop all pages behind to relax memory usage (if OS
      supports madvise syscall).
      
      Another important moment is that we're marking the whole stack
      as not present thus if fiber never stepped over 64K limit the
      marks will be in tact and it means the fibers are light ones
      there won't be much #pf in future.
      
      Later we plan to implement an intelligent fiber scheduling
      considering how many memory fibers consume in average.
      
      @locker:
       - fix watermark page alignment for grow-up stack
       - improve MADV_DONTNEED check
       - clean up code and elaborate comments
       - add test case to unit/fiber
       - fix unit/guard test
      
      Follow-up #3418
      553dc562
  6. Mar 04, 2019
  7. Feb 26, 2019
    • Vladislav Shpilevoy's avatar
      Move 'core' and 'uuid' libs to src/lib · 3f5f59bb
      Vladislav Shpilevoy authored
      For the same reason why 'uri' was moved to src/lib - SWIM needs
      core and uuid, and SWIM will live in src/lib.
      
      This commit follows 'uri' relocation as a separate one because
      'uri' relocation required some changes in the files, moved by
      this commit.
      
      Needed for #3234
      3f5f59bb
  8. Dec 14, 2018
    • Vladimir Davydov's avatar
      xlog: fix fallocate vs read race · b9db91e1
      Vladimir Davydov authored
      posix_fallocate(), which is used for preallocating disk space for WAL
      files, increases the file size and fills the allocated space with zeros.
      The problem is a WAL file may be read by a relay thread at the same time
      it is written to. We try to handle the zeroed space in xlog_cursor (see
      xlog_cursor_next_tx()), however this turns out to be not enough, because
      transactions are written not atomically so it may occur that a writer
      writes half a transaction when a reader reads it. Without fallocate, the
      reader would stop at EOF until the rest of the transaction is written,
      but with fallocate it reads zeroes instead and thinks that the xlog file
      is corrupted while actually it is not.
      
      Fix this issue by using fallocate() with FALLOC_FL_KEEP_SIZE flag
      instead of posix_fallocate(). With the flag fallocate() won't increase
      the file size, it will only allocate disk space beyond EOF.
      
      Closes #3883
      b9db91e1
  9. Oct 25, 2018
  10. Oct 08, 2018
    • Vladimir Davydov's avatar
      cmake: fix sync_file_range detection · e1aa1a3d
      Vladimir Davydov authored
      sync_file_range is declared only if _GNU_SOURCE macro is defined.
      Also, in order to be used in a source file, HAVE_SYNC_FILE_RANGE
      must be present in config.h.cmake.
      
      Fixes commit caae99e5 ("Refactor xlog writer").
      e1aa1a3d
  11. Sep 06, 2018
    • Georgy Kirichenko's avatar
      Tarantool static build ability · cb1c72da
      Georgy Kirichenko authored
      A possibility to build tarantool with included library dependencies.
      Use the flag -DBUILD_STATIC=ON to build statically against curl, readline,
      ncurses, icu and z.
      Use the flag -DOPENSSL_USE_STATIC_LIBS=ON to build with static
      openssl
      
      Changes:
        * Add FindOpenSSL.cmake because some distributions do not support the use of
        openssl static libraries.
        * Find libssl before curl because of build dependency.
        * Catch all bundled libraries API and export then it in case of static
        build.
        * Rename crc32 internal functions to avoid a name clash with linked libraries.
      
      Notes:
        * Bundled libyaml is not properly exported, use the system one.
        * Dockerfile to build static with docker is included
      
      Fixes #3445
      cb1c72da
  12. Aug 21, 2018
    • Konstantin Belyavskiy's avatar
      Add FindICONV and iconv wrapper · dcac64af
      Konstantin Belyavskiy authored
      Fixing build under FreeBSD:
      Undefined symbol "iconv_open"
      Add compile time build check with FindICONV.cmake
      and a wrapper to import relevant symbol names with include file.
      
      Closes #3441
      dcac64af
  13. Oct 06, 2017
  14. Sep 26, 2017
    • Alexander Turenko's avatar
      Add an option to allow using system ZStd · 664fc51e
      Alexander Turenko authored
      The option is '-DENABLE_BUNDLED_ZSTD' and defaults to ON.
      
      There are two goals of making this conditional, both related to building
      Tarantool on Gentoo Linux from an ebuild:
      
      * Avoid bundled ZStd building issue w/o pay to investivage it.
      * Allow user to choose between system and bundled library.
      664fc51e
  15. Sep 14, 2017
  16. Sep 05, 2017
  17. Aug 22, 2017
    • Roman Tsisyk's avatar
      Replace gopt with getopt_long() · f6370335
      Roman Tsisyk authored
      getopt_long() is available on all supported platforms.
      Get rid of legacy gopt and use getopt_long().
      
      Incompatible changes:
      
       * `tarantool --version --no-such-option` printed
          "unrecognized option '--no-such-option'", now it displays version.
          `tarantool --no-such-option --version` still prints an error message.
      
      Needed for #1265
      f6370335
  18. Aug 03, 2017
  19. Jul 28, 2017
  20. Jul 24, 2017
  21. Jun 16, 2017
  22. May 12, 2017
    • Kirill Yukhin's avatar
      Introduce SQL maintainer mode. · 38c5400f
      Kirill Yukhin authored
      This patch removes following source files regeneration:
        1. keywordhash.h
        2. opcodes.[hc]
        3. parse.[hc]
        4. sqlite3.h
      adding them to the source tree.
      
      To re-generate them (p.p. 1-3) one must pass
      -DSQL_MAINTAINER_MODE=ON option to cmake. Files will be
      copied to source tree automatically iif actual difference will
      be detected.
      
      As far we don't need such platform variety - remove sqlite3.h
      re-generation at all.
      Remove TCL script responsible for generation and template header
      as well.
      
      Compilation of auxilary SQL tools was also moved under this option:
        1. Lemon parser
        2. mkkeywordhash
      since they redundant in non-maintainer mode.
      
      Finally it removes dependency on TCL from all Tarantool package
      variants.
      
      Remove sqliteConfig.h, we don't use it.
      38c5400f
  23. May 10, 2017
  24. May 05, 2017
    • Nick Zavaritsky's avatar
      Check in sqlite 3.16.2 · d0a9dfed
      Nick Zavaritsky authored
      * do not include autotools build files
      
      sql: [#2387] [#2267] Cleanup unused SQLite fines.
      
      sql: Checkin SQLite test coverage
      
      sql: Remove TCL-based tests
      
      Remove sqlite-tcl testsuite along with all TCL-relared libs.
      Clean up sqlite's CMakeLists and remove redundant TCL-related
      sources.
      
      	* src/lib/sqlite/CMakeLists.txt: Remove dependency on TCL library.
      	* src/lib/sqlite/src/CMakeLists.txt: Remove testfixture target.
      	* src/lib/sqlite/src/test.*: Remove.
      	* src/lib/sqlite/src/sqlite3.rc: Ditto.
      	* src/lib/sqlite/src/tclsqlite.c: Ditto.
      	* src/lib/sqlite/ext: Ditto.
      	* test/sqlite-tcl: Ditto.
      
      Add -o option in lemon (output file name)
      
      This is necessary for out-of-source CMake builds.
      
      Use dummy commit date and UUID in sqlite3.h
      
      Last commit date and UUID are included in generated sqlite3.h. We don't
      distribute standalone sqlite, and Tarantool itself is already
      version-stamped.
      
      sqlite: Add VERSION
      Implement CMake build rules for sqlite.
      d0a9dfed
  25. Feb 15, 2017
    • Roman Tsisyk's avatar
      Remove Sophia from 1.6 · 5336dbf6
      Roman Tsisyk authored
      Sophia was an experimental storage engine in 1.6.x.
      Please use 'vinyl' engine in Tarantool 1.7 instead.
      
      Closes #2040
      5336dbf6
  26. Feb 13, 2017
  27. Feb 11, 2017
    • Roman Tsisyk's avatar
      NetBSD port · 870e8d71
      Roman Tsisyk authored
      * Check for missing cpuid.h header
      * Fix sed magic in extra/mkexports
      * Fix open_memstream implementation
      * Fix CLOCK_PROCESS_CPUTIME_ID / CLOCK_THREAD_CPUTIME_ID
      * Disable stupid -Wchar-subscripts warnings
      * Add a workaround for "undefined __gcc_personality_v0"
      
      Tested on NetBSD 7 and on x86_64-rumprun-netbsd.
      Now you can use Tarantool on toasters.
      870e8d71
  28. Feb 07, 2017
  29. Dec 23, 2016
    • Roman Tsisyk's avatar
      Initial support for valgrind · a27607d1
      Roman Tsisyk authored
      This patch is not perfect, but it is better than nothing.
      
      + Remove third_party/valgrind and third_party/pmatomic which
        also exist in src/lib/small/third_party.
      a27607d1
  30. Nov 01, 2016
    • Georgy Kirichenko's avatar
      Refactor xlog writer · caae99e5
      Georgy Kirichenko authored
      * Write xlog via fd instead of fiob with FILE * interface
      
      * Remove O_DIRECT mode, use fdatasync(2)/sync_file_range(2) with
        posix_fadvise(2) to free the page cache. Disk cache polution
        on snapshot was tested with `vmtouch` utility and fadvise()
        provides similar result to O_DIRECT.
      
      * Remove fiob.c implementation (unused)
      caae99e5
  31. Oct 17, 2016
    • Nick Zavaritsky's avatar
      gh-1765: Implement ASAN builds · afd22939
      Nick Zavaritsky authored
      Make sure llvm-symbolizer is available. If not, reports will contain raw
      addresses instead of line info.
      
      Since leak suppressions aren't ready yet, we suggest setting
      ASAN_OPTIONS=detect_leaks=0 environment variable when running tests.
      afd22939
  32. Sep 29, 2016
  33. Sep 27, 2016
  34. Sep 23, 2016
  35. Aug 15, 2016
  36. Jul 28, 2016
  37. Jul 15, 2016
Loading