Skip to content
Snippets Groups Projects
  1. Feb 11, 2015
    • Konstantin Osipov's avatar
      hot standby mode: fix broken read only mode during hot standby · eceb9a28
      Konstantin Osipov authored
      Fix a bug when the server would enter read-write mode prematurely
      in hot standby mode, and let the script continue and try to create
      spaces/indexes.
      
      The bug is a regression introduced by the patch which changed cfg.listen
      to a dynamic option.
      
      This is an *incompatible* change: box.cfg{} used to return before binding
      to the primary port, this is no llonger the case.
      
      Always bind to the listen port in box.cfg{} call, not in the background,
      and leave local hot standby mode *before* leaving box.cfg{}.
      
      This avoids tons of tricky race conditions in user scripts when box.cfg{}
      has ended but the server is actually still read only. Except, thanks to
      another bug in box_set_cluster_id(), it wasn't really read-only, because
      box_set_cluster_id() would switch off read-only mode before local hot
      standby has ended (so a superposition of two bugs).
      
      The manifestation of this  was as follows:
      
      Imagine the following script:
          box.cfg{listen = 3301}
          box.schema.space.create('tester')
          box.space.tester:create_index('primary')
      
      The server would start in local hot standby mode. Save a snapshot.
      Fall through to DDL. Then leave local hot standby and turn on
      WAL. The created space will end up not being in the write
      ahead log.
      
      The problem wasn't noticable in most cases, since the server could
      bind to the primary port quite quickly.
      
      Fix the test runner to detect a local hot standby server as started.
      
      Add a workaround for gh-721 until a complete patch is ready.
      eceb9a28
  2. Feb 10, 2015
  3. Feb 09, 2015
  4. Feb 06, 2015
  5. Feb 05, 2015
  6. Feb 04, 2015
Loading