Skip to content
Snippets Groups Projects
  1. Jul 12, 2018
  2. Jul 11, 2018
    • Vladimir Davydov's avatar
      box: factor out local recovery function · ab5c8a22
      Vladimir Davydov authored
       - Factor out local_recovery() from box_cfg_xc(). Make it setup
         replication and handle local recovery and hot standby cases.
       - Move replication setup in case of initial bootstrap from box_cfg_xc()
         to bootstrap() to make bootstrap() consistent with local_recovery().
       - Move initial snapshot creation from bootstrap() to bootsrap_master()
         and bootstrap_from_master().
      
      Needed for #461
      ab5c8a22
    • Vladimir Davydov's avatar
      box: connect to remote peers before starting local recovery · 2c32252b
      Vladimir Davydov authored
      box_sync_replication() can now be called before recovery, right after
      box_listen(). This is a step toward detecting if the instance fell too
      much behind its peers in the cluster and so needs to be rebootstrapped.
      
      Needed for #461
      2c32252b
    • Vladimir Davydov's avatar
      box: open the port before starting local recovery · 601bb92a
      Vladimir Davydov authored
      In order to find out if the current instance fell too much behind its
      peers in the cluster and so needs to be re-bootstrapped we need to
      connect it to remote peers before proceeding to local recovery. The
      problem is box.cfg.replication may have an entry corresponding to the
      instance itself so before connecting we have to start listening to
      incoming connections. So this patch moves the call to box_listen()
      before recoery is started unless the instance in hot standby mode.
      It also folds box_bind() into box_listen() as it is no longer needed
      as a separate function.
      
      Needed for #461
      601bb92a
    • Vladimir Davydov's avatar
      box: retrieve end vclock before starting local recovery · 0695fbbb
      Vladimir Davydov authored
      In order to find out if the current instance fell too much behind its
      peers in the cluster and so needs to be rebootstrapped, we need to know
      its vclock before we start local recovery. To do that, let's scan the
      most recent xlog. In future, we can optimize that by either storing end
      vclock in xlog eof marker or by making a new xlog on server stop.
      
      Needed for #461
      0695fbbb
    • Vladimir Davydov's avatar
      xlog: get rid of xlog_meta::has_prev_vclock · fa46ed59
      Vladimir Davydov authored
      Introduce vclock_is_set() helper and use it on xlog_meta::prev_vclock
      instead.
      
      Follow-up ac90b498 ("xlog: store prev vclock in xlog header").
      fa46ed59
    • Vladislav Shpilevoy's avatar
      sql: remove OP_LoadPtr · 9c36ef5b
      Vladislav Shpilevoy authored
      This opcode was used when Vdbe had to store key_def in P4 for
      OP_OpenRead/Write, so P4 was occupied and OP_LoadPtr was used to
      store space pointer in another opcode. But now P4 is free for
      OpenRead/Write and space pointer can be stored here.
      
      Alongside, some useless key_def duplications are removed.
      9c36ef5b
    • Kirill Shcherbatov's avatar
      sql: refactor vdbe_emit_open_cursor calls · 6c6162e4
      Kirill Shcherbatov authored
      Made vdbe_emit_open_cursor calls consistent:
      now it uses index id everywhere.
      This required to change a way to detect that
      VDBE has openned Read cursor to specified table
      in vdbe_has_table_read to write result of insert
      in temp table if required.
      6c6162e4
    • Kirill Shcherbatov's avatar
      sql: remove usless sqlite3NestedParse function · b118296b
      Kirill Shcherbatov authored
      As sqlite3NestedParse became totaly useless, let's
      remove unreacheble code and all mentioning.
      
      Resolves #3496.
      b118296b
    • Kirill Shcherbatov's avatar
      sql: get rid off sqlite3NestedParse in clean stats · 47e1e4db
      Kirill Shcherbatov authored
      Now we manually generate AST structures to drop outdated
      stats from _sql_stat1 and _sql_stat4 spaces instead of
      starting sqlite3NestedParse. This function becomes totally
      useless and could be removed.
      
      Part of #3496.
      47e1e4db
  3. Jul 10, 2018
  4. Jul 09, 2018
    • Vladimir Davydov's avatar
      txn: do not require space id for nop requests · 7073782d
      Vladimir Davydov authored
      Currently, IPROTO_NOP can only be generated by a before_replace trigger,
      when it returns the old tuple thus turning the original operation into a
      NOP. In such a case we know the space id and we write it to the request
      body. This allows us to dispatch NOP requests via DML route.
      
      As a part of replica local spaces feature, we will substitute requests
      operating on local spaces with NOP in relay in order to promote vclock
      on replicas without actual data modification. Since space_id is stored
      in request body, sending it to replicas would mean decoding the request
      body in relay, which is an overkill. To avoid that, let's separate NOP
      and DML paths and remove space_id from NOP requests.
      
      Needed for #3443
      7073782d
    • Vladimir Davydov's avatar
      alter: fix modification of primary key definition · 3f14e319
      Vladimir Davydov authored
      If pk_def passed to index_def_new() is not NULL, the function will merge
      it with the given key_def to create index cmp_def, no matter if the
      index is primary or secondary. When an index is altered, we call
      index_def_new() to create the new definition, passing the primary key
      definition of the altered space for pk_def. If it is the primary index
      that is altered, we will pass the definition of the old primary index
      and index_def_new() will happily merge it with the new index definition,
      resulting in invalid index_def::cmp_def. This doesn't affect memtx, as
      memtx doesn't use cmp_def for unique indexes, but it does affect vinyl
      in a peculiar way:
      
        tarantool> _ = box.schema.space.create('test', {engine = 'vinyl'})
        ---
        ...
      
        tarantool> _ = box.space.test:create_index('pk')
        ---
        ...
      
        tarantool> _ = box.space.test.index.pk:alter{parts = {2, 'unsigned'}}
        ---
        ...
      
        tarantool> _ = box.space.test:replace{1, 1}
        ---
        ...
      
        tarantool> _ = box.space.test:replace{2, 1}
        ---
        ...
      
        tarantool> box.space.test:select()
        ---
        - - [1, 1]
          - [2, 1]
        ...
      
      (expected: [2, 1])
      
      Fix this by making index_def_new() merge key_def with pk_def only for
      secondary indexes.
      
      Closes #3508
      3f14e319
    • Serge Petrenko's avatar
      Add a privilege check when creating a sequence · 1318ac44
      Serge Petrenko authored
      There was no check for create privilege when creating a sequence.
      Added one, and modified the tests accordingly.
      1318ac44
    • Serge Petrenko's avatar
      Replace net.box usage with console in tarantoolctl eval · 7c3f9ceb
      Serge Petrenko authored
      Net.box usage for console is deprecated in 1.10,
      replaced it with console.
      
      Closes: #3490
      7c3f9ceb
    • Konstantin Osipov's avatar
      Merge branch '1.9' into 1.10 · 96476ea4
      Konstantin Osipov authored
      96476ea4
    • Serge Petrenko's avatar
      Do not update schema_version on space:truncate(). · 2407e389
      Serge Petrenko authored
      Schema version is used by both clients and internal modules to check
      whether there vere any updates in spaces and indices. While clients
      only need to be notified when there is a noticeable change, e.g.
      space is removed, internal components also need to be notified when
      something like space:truncate() happens, because even though this
      operation doesn't change space id or any of its indices, it creates a
      new space object, so all the pointers to the old object have to be updated.
      Currently both clients and internals share the same schema version, which
      leads to unnecessary updates on the client side.
      
      Fix this by implementing 2 separate counters for internal and public use:
      schema_state gets updated on every change, including recreation of the same
      space object, while schema_version is updated only when there are noticable
      changes for the clients. Introduce a new AlterOp to alter.cc to update
      public schema_version.
      Now all the internals reference schema_state, while all the clients use
      schema_version. box.iternal.schema_version() returns schema_version
      (the public one).
      
      Closes: #3414
      2407e389
  5. Jul 06, 2018
Loading