A set of Neutron drivers for the VMware NSX.
Go to file
Kevin Benton 029e9f7c5a BSN: Optimistic locking strategy for consistency
Summary:
  Adds an optimistic locking strategy for the Big Switch
  server manager so multiple Neutron servers wanting to
  communicate with the backend do not receive the consistency
  hash for use simultaneously.

  The bsn-rest-call semaphore is removed because serialization
  is now provided by the new locking scheme.

  A new DB engine is added because the consistency hashes
  need a life-cycle with rollbacks and other DB operations
  than cannot impact or be impacted by database operations
  happening on the regular Neutron objects.

  Unit tests are included for each of the new branches
  introduced.

Problem Statement:
  Requests to the Big Switch controllers must contain the
  consistency hash value received from the previous update.
  Otherwise, an inconsistency error will be triggered which
  will force a synchronization. Essentially, a new backend
  call must be prevented from reading from the consistency
  hash table in the DB until the previous call has updated
  the table with the hash from the server response.

  This can be addressed by a semaphore around the rest_call
  function for the single server use case and by a table lock
  on the consistency table for multiple Neutron servers.
  However, both solutions are inadequate because a single
  Neutron server does not scale and a table lock is not
  supported by common SQL HA deployments (e.g. Galera).

  This issue was previously addressed by deploying servers
  in an active-standby configuration. However, that only
  prevented the problem for HTTP API calls. All Neutron
  servers would respond to RPC messages, some of which would
  result in a port update and possible backend call which
  would trigger a conflict if it happened at the same time
  as a backend call from another server. These unnecessary
  syncs are unsustainable as the topology increases beyond
  ~3k VMs.

  Any solution needs to be back-portable to Icehouse so new
  database tables, new requirements, etc. are all out of the
  question.

Solution:
  This patch stores the lock for the consistency hash as a part
  of the DB record. The guaruntees the database offers around
  atomic insertion and constrained atomic updates offer the
  primitives necessary to ensure that only one process/thread
  can lock the record at once.

  The read_for_update method is modified to not return the hash
  in the database until an identifier is inserted into the
  current record or added as a new record. By using an UPDATE
  query with a WHERE clause restricting to the current state,
  only one of many concurrent callers to the DB will successfully
  update the rows. If a caller sees that it didn't update any
  rows, it will start the process over of trying to get the
  lock.

  If a caller observes that the same ID has the lock for
  more than 60 seconds, it will assume the holder has
  died and will attempt to take the lock. This is also done
  in a concurrency-safe UPDATE call since there may be many
  other callers may attempt to do the same thing. If it
  fails and the lock was taken by someone else, the process
  will start over.

  Some pseudo-code resembling the logic:
    read_current_lock
    if no_record:
      insert_lock
      sleep_and_retry if constraint_violation else return
    if current_is_locked and not timer_exceeded:
      sleep_and_retry
    if update_record_with_lock:
      return
    else:
      sleep_and_retry

Closes-Bug: #1374261
Change-Id: Ifa5a7c9749952bc2785a9bf3fed69ad55bf21acc
2014-11-19 05:43:18 +00:00
bin Remove the useless vim modelines 2014-06-21 15:07:31 +08:00
doc Implement ModelsMigrationsSync test from oslo.db 2014-09-30 11:55:06 +04:00
etc Merge "Update default value for agent_required attribute" 2014-11-13 16:02:06 +00:00
neutron BSN: Optimistic locking strategy for consistency 2014-11-19 05:43:18 +00:00
rally-scenarios Add config for performance gate job 2014-06-26 14:27:15 +03:00
tools Remove the useless vim modelines 2014-06-21 15:07:31 +08:00
.coveragerc fix some missing change from quantum to neutron 2013-07-08 12:11:04 +08:00
.gitignore Ignore emacs checkpoint files 2014-06-18 13:48:41 -05:00
.gitreview Rename quantum to neutron in .gitreview. 2013-07-06 12:25:09 -04:00
.mailmap Add mailmap entry 2014-05-16 13:40:04 -04:00
.pylintrc Merge "Enable assignment-from-no-return pylint check" 2014-11-11 03:31:19 +00:00
.testr.conf Add an explicit tox job for functional tests 2014-02-05 17:11:52 +00:00
babel.cfg Use babel to generate translation file 2013-01-24 00:20:32 +08:00
CONTRIBUTING.rst Add CONTRIBUTING.rst 2014-07-08 23:49:07 +08:00
HACKING.rst Update i18n translation for neutron.agents log msg's 2014-11-15 00:08:20 -08:00
LICENSE Adding Apache Version 2.0 license file. This is the official license agreement under which Quantum code is available to 2011-08-08 12:31:04 -07:00
MANIFEST.in Rename Quantum to Neutron 2013-07-06 15:02:43 -04:00
openstack-common.conf switch to oslo.serialization 2014-11-14 09:28:12 +00:00
README.rst Make readme reference git.openstack.org not github 2014-07-17 10:57:12 +02:00
requirements.txt Updated from global requirements 2014-11-09 00:39:32 +00:00
run_tests.sh Provide a quick way to run flake8 2014-08-30 21:30:17 +09:00
setup.cfg Remove openvswitch core plugin entry point 2014-11-10 23:05:04 +01:00
setup.py Updated from global requirements 2014-04-30 02:41:29 +00:00
test-requirements.txt Updated from global requirements 2014-11-09 00:39:32 +00:00
TESTING.rst Merge "Add a gate-specific tox env for functional tests" 2014-07-19 02:48:16 +00:00
tox.ini enable F812 check for flake8 2014-11-14 17:17:42 -05:00

# -- Welcome!

You have come across a cloud computing network fabric controller. It has identified itself as "Neutron." It aims to tame your (cloud) networking!

# -- External Resources:

The homepage for Neutron is: http://launchpad.net/neutron. Use this site for asking for help, and filing bugs. Code is available on git.openstack.org at <http://git.openstack.org/cgit/openstack/neutron>.

The latest and most in-depth documentation on how to use Neutron is available at: <http://docs.openstack.org>. This includes:

Neutron Administrator Guide http://docs.openstack.org/trunk/openstack-network/admin/content/

Neutron API Reference: http://docs.openstack.org/api/openstack-network/2.0/content/

The start of some developer documentation is available at: http://wiki.openstack.org/NeutronDevelopment

For help using or hacking on Neutron, you can send mail to <mailto:openstack-dev@lists.openstack.org>.