Skip to content
Snippets Groups Projects
  1. Oct 28, 2019
    • Vladislav Shpilevoy's avatar
      replication: auto reconnect if password is invalid · aa2e2c56
      Vladislav Shpilevoy authored
      Before the patch there was a race in replication
      password configuration. It was possible that a replica
      connects to a master with a custom password before
      that password is actually set. The replica treated the
      error as critical and exited.
      
      But in fact it is not critical. Replica even can
      withstand absence of a user and keeps reconnecting.
      Wrong password situation arises from the same problem
      of non atomic configuration and is fixed the same -
      keep reconnect attempts if the password was wrong.
      
      Closes #4550
      aa2e2c56
    • Vladislav Shpilevoy's avatar
      key_def: key_def.new() accept both 'field' and 'fieldno' · 39918baf
      Vladislav Shpilevoy authored
      Closes #4519
      
      @TarantoolBot document
      Title: key_def.new() accept both 'field' and 'fieldno'
      
      Before the patch key_def.new() took an index part
      array as it is returned in <index_object>.parts: each
      part should include 'type', 'fieldno', and what else
      .parts element contains.
      
      But it was not possible to create a key_def from an
      index definition - the array passed to
      <space_object>.create_index() 'parts' argument. Because
      key_def.new() didn't recognize 'field' option. That
      might be useful, when a key_def is needed on a remote
      client, where a space object and its indexes do not
      exist. And it would be strange to force a user to
      create them just so as he would be able to access
      
          <net_box connection>.space.<space_name>.
              index.<index_name>.parts
      
      As well as it would be crutchy to make a user manually
      replace 'field' with 'fieldno' in its index definition
      just to create a key_def.
      
      Additionally, an ability to pass an index definition
      to a key_def constructor makes the API more symmetric.
      
      Note, that it still is not 100% symmetric, because a
      user can't pass field names to the key_def
      constructor. A space is needed for that anyway.
      39918baf
    • Vladislav Shpilevoy's avatar
      replication: use strict order for replication settings · 00c6c437
      Vladislav Shpilevoy authored
      The previous patch introduced a way to set box.cfg options
      in a strict order, even on a reconfiguration. It was used to set
      listen before replication.
      The same order problem existed for replication settings. A user
      could do
      
          box.cfg{
              replication_connect_quorum = 0,
              replication = {...}
          }
      
      and expect, that due to quorum 0 the cfg() will return
      immediately. But actually the behaviour was undefined - due to
      arbitrary order of keys in a Lua table, replication could be
      applied before quorum.
      
      The patch makes all replication settings be applied before
      replication.
      
      Follow up #4433
      Part of #3760
      00c6c437
    • Vladislav Shpilevoy's avatar
      box: raise an error on nil replicaset and instance uuid · a8ebd334
      Vladislav Shpilevoy authored
      Before the patch the nil UUID was ignored and a new random one
      was generated. This was because internally box treats nil UUID
      as its absence.
      
      Now a user will see an explicit message that nil UUID is a
      reserved value.
      
      Closes #4282
      a8ebd334
  2. Oct 24, 2019
    • Alexander V. Tikhonov's avatar
      travis-ci/gitlab-ci: add ubuntu 19.10 · c6cd2e62
      Alexander V. Tikhonov authored
      
      Added Ubuntu 19.10 Eoan Ermine into CI.
      
      Close #4583
      
      Reviewed-by: default avatarAlexander Turenko <alexander.turenko@tarantool.org>
      Unverified
      c6cd2e62
    • Oleg Babin's avatar
      build: fix static build condition about testing · 8c85dbc7
      Oleg Babin authored
      
      Before this patch RUN_TESTS condition in Dockerfile.staticbuild was
      ignored and always was true.
      
      However adding of brackets solves only part of problem. If RUN_TESTS is
      empty `sh -c` returns 1 and build fails.
      
      However if we run tests we should fail build if tests are not passed.
      Ternary logic was rewritten to fair if-else.
      
      This patch fixes it and allows build tarantool statically without
      running tests.
      
      @Totktonada: Fixed .gitlab.mk to pass RUN_TESTS environment variable to
      docker build arguments.
      
      Reviewed-by: default avatarAlexander Turenko <alexander.turenko@tarantool.org>
      Unverified
      8c85dbc7
    • Nikita Pettik's avatar
      sql: fix off-by-one error in QP · bb905d1d
      Nikita Pettik authored
      In scope of 8fac6972 it was fixed misbehavior while passing floating
      point values to integer iterator. Unfortunately, that patch introduced
      off-by-one error. Number of constraints (equalities and inequalities)
      can not be greater than number of key parts (obviously, each constraint
      can be tested against at most one index part). Inequality constraint can
      involve only field representing last key part. To get it number of
      constraints was used as index. However, since array is 0-based, the last
      key part should be calculated as parts[eq_numb - 1]. Before this patch
      it was parts[eq_numb].
      
      Closes #4558
      bb905d1d
    • Ilya Kosarev's avatar
      replication: cancel replica joining thread at exit · 12244ad9
      Ilya Kosarev authored
      If a tarantool instance exits while joining replica is in progress,
      the replica joining thread can access already freed data resulting
      in a crash. Let's fix this the same way we did for checkpoint thread
      - simply cancel the thread forcefully and wait for it to terminate.
      
      Closes #4528
      12244ad9
  3. Oct 23, 2019
  4. Oct 21, 2019
  5. Oct 20, 2019
    • Nikita Pettik's avatar
      sql: remove expmask from prepared statement · 8aa685fb
      Nikita Pettik authored
      expmask indicated necessity to recompile statement after parameter was
      bound: it might turn out that parameter can affect query plan. However,
      part of this mechanism has been removed long ago as a SQLite's legacy.
      In its current state expmask is likely to be useless and assertions
      involving it are obviously unsuitable. This patch completely removes
      expmask and related routines.
      
      Closes #4566
      8aa685fb
  6. Oct 17, 2019
  7. Oct 16, 2019
    • Kirill Shcherbatov's avatar
      sql: use name instead of function pointer for UDF · de9a7b1a
      Kirill Shcherbatov authored
      This patch changes OP_Function parameters convention: now a
      function's name is passed instead of pointer to the function
      object. This allows to normally handle the situation, when UDF
      has been deleted to the moment of the VDBE code execution.
      In particular case this may happen with CK constraints that
      refers to a deleted persistent function.
      
      Closes #4176
      de9a7b1a
    • Kirill Shcherbatov's avatar
      sql: add an ability to disable CK constraints · c4781f93
      Kirill Shcherbatov authored
      Closes #4244
      
      @TarantoolBot document
      Title: an ability to disable CK constraints
      
      Now it is possible to disable and enable ck constraints.
      All ck constraints are enabled by default when Tarantool is
      configured. Ck constraints checks are not performed during
      standard recovery, but performed during force_recovery -
      all conflicting tuples are skipped in case of ck_constraint
      conflict.
      
      To change CK constraint "is_enabled" state, call
      -- in LUA
      ck_obj:enable(new_state in {true, false})
      -- in SQL
      ALTER TABLE {TABLE_NAME} {EN, DIS}ABLE CHECK CONSTRAINT {CK_NAME};
      
      Example:
      box.space.T6.ck_constraint.ck_unnamed_T6_1:enable(false)
      box.space.T6.ck_constraint.ck_unnamed_T6_1
      - space_id: 512
        is_enabled: false
        name: ck_unnamed_T6_1
        expr: a < 10
      box.space.T6:insert({11})
      -- passed
      box.execute("ALTER TABLE t6 ENABLE CHECK CONSTRAINT \"ck_unnamed_T6_1\"")
      box.space.T6:insert({12})
      - error: 'Check constraint failed ''ck_unnamed_T6_1'': a < 10'
      c4781f93
    • Kirill Shcherbatov's avatar
      box: add an ability to disable CK constraints · 9a058bb2
      Kirill Shcherbatov authored
      Now it is possible to disable and enable ck constraints in LUA.
      This option is persistent. All ck constraints are constructed
      in enabled state when Tarantool is configured. This ability
      may be usefulwhen processed data is verified and constraints
      validation is not required. For instance, during casual recovery
      process there's no need to provide any checks since data is
      assumed to be consistent.
      
      Persisting is_enabled flag is an important feature.
      If the option is not stored the following scenario is
      possible:
      - the option is turned off
      - data is changed so that a constraint is violated
      - the system is restarted while the option state is lost
      - there is no way (even in theory) to discover it and find that
        data is incorrect.
      
      Part of #4244
      9a058bb2
  8. Oct 15, 2019
    • Alexander Turenko's avatar
      test: update test-run · 18864835
      Alexander Turenko authored
      test_run:wait_upstream() and test_run:wait_downstream() now wait until
      an upstream / a downstream appears. This prevents an attempt to index a
      nil value when one of those functions are called before a record about a
      peer appears in box.info.replication. It was observed on
      replication/show_error_on_disconnect test after commit
      c6bea65f ('replication: recfg with 0
      quorum returns immediately').
      
      Fixes #4563.
      Unverified
      18864835
    • Kirill Shcherbatov's avatar
      sql: remove redundant pointer in TriggerStep · a50be270
      Kirill Shcherbatov authored
      The trigger pointer in the sql_trigger structure is a dead code
      now, so it could be deleted.
      
      Needed for #4343
      a50be270
  9. Oct 14, 2019
    • Mergen Imeev's avatar
      sql: AUTOINCREMENT for multipart PK · 08c7d7c1
      Mergen Imeev authored
      Prior to this patch, the auto-increment feature could only be set
      in an INTEGER field of PRIMARY KEY if the PRIMARY KEY consisted of
      a single field. It was not possible to use this feature if the
      PRIMARY KEY consisted of more than one field. This patch defines
      two ways to set AUTOINCREMENT for any INTEGER or UNSIGNED field of
      PRIMARY KEY.
      
      Closes #4217
      
      @TarantoolBot document
      Title: The auto-increment feature for multipart PK
      The auto-increment feature can be set to any INTEGER or UNSIGNED
      field of PRIMARY KEY using one of two ways:
      1) AUTOINCREMENT in column definition:
      CREATE TABLE t (i INT, a INT AUTOINCREMENT, PRIMARY KEY (i, a));
      CREATE TABLE t (i INT AUTOINCREMENT, a INT, PRIMARY KEY (i, a));
      2) AUTOINCREMENT in PRIMARY KEY definition:
      CREATE TABLE t (i INT, a INT, PRIMARY KEY (i, a AUTOINCREMENT));
      CREATE TABLE t (i INT, a INT, PRIMARY KEY (i AUTOINCREMENT, a));
      08c7d7c1
  10. Oct 12, 2019
    • Vladislav Shpilevoy's avatar
      replication: recfg with 0 quorum returns immediately · c6bea65f
      Vladislav Shpilevoy authored
      Replication quorum 0 not only affects orphan status, but also,
      according to documentation, makes box.cfg() return immediately
      regardless of whether connections to upstreams are established.
      
      It was not so before the patch. What is worse, even with non 0
      quorum the instance was blocked on reconfiguration for connect
      timeout seconds, if at least one node is not connected.
      
      Now quorum is respected on reconfiguration. On a bootstrap it is
      still impossible to return earlier than
      replication_connect_timeout, because nodes need to choose some
      cluster settings. Too early start would make it impossible -
      cluster's participants will just start and choose different
      cluster UUIDs.
      
      Closes #3760
      c6bea65f
  11. Oct 09, 2019
    • Serge Petrenko's avatar
      replication: add is_orphan field to ballot · dc1e4009
      Serge Petrenko authored
      A successfully fetched remote instance ballot isn't updated during
      bootstrap procedure. This leads to a case when different instances
      choose different masters as their bootstrap leaders.
      
      Imagine such a situation.
      You start instance A without replication set up. Instance A successfully
      bootstraps.
      You also have instances B and C both with replication set up to {A, B,
      C} and replication_connect_quorum set to 3
      You first start instance B. It doesn't proceed to choosing a leader
      until one of the events happens: either the replication_connect_timeout
      runs out, or instance C is up and starts listening on its port.
      B has established connection to A and fetched its ballot, with some
      vclock, say, {1: 1}.
      B retries connection to C every replication_timeout seconds.
      Then you start instance C. Instance C succeeds in connecting to A and B
      right away and bootstraps from instance A. Instance A registers C in its
      _cluster table. This registration is replicated to instance C.
      Meanwhile, instance C is trying to sync with quorum instances (which is
      3), and stays in orphan mode.
      Now replication_timeout on instance B finally runs out. It retries a
      previously unsuccessful connection to C and succeeds. C sends its ballot
      to B with vclock = {1: 2, 2:0} (in our example), since it has already
      incremented it after _cluster registration.
      B sees that C has a greater vclock than A, and chooses to bootstrap from
      C instead of A. C is orphan and rejects B's attempt to join. B dies.
      
      To fix such ungentlemanlike behaviour of C, we should at least include
      loading status in ballot and prefer fully bootstrapped instances to the
      ones still syncing with other replicas.
      We also need to use a separate flag instead of ballot's already existent
      is_ro, since we still want to prefer loading instances over the ones
      explicitly configured to be read-only.
      
      Closes #4527
      dc1e4009
    • Kirill Yukhin's avatar
    • Cyrill Gorcunov's avatar
      box/console: Fix missing variable declaration · df821d0f
      Cyrill Gorcunov authored
      
      During rework of the console lua mode series
      the declaration of variable has been lost and
      this cause test case for remote unix console
      connection to fail.
      
      Fixes issue from c358398c
      
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      df821d0f
  12. Oct 04, 2019
Loading