nova/nova/cmd
melanie witt 5c544c7e2a Warn for duplicate host mappings during discover_hosts
When the 'nova-manage cellv2 discover_hosts' command is run in parallel
during a deployment, it results in simultaneous attempts to map the
same compute or service hosts at the same time, resulting in
tracebacks:

  "DBDuplicateEntry: (pymysql.err.IntegrityError) (1062, u\"Duplicate
  entry 'compute-0.localdomain' for key 'uniq_host_mappings0host'\")
  [SQL: u'INSERT INTO host_mappings (created_at, updated_at, cell_id,
  host) VALUES (%(created_at)s, %(updated_at)s, %(cell_id)s,
  %(host)s)'] [parameters: {'host': u'compute-0.localdomain',
  %'cell_id': 5, 'created_at': datetime.datetime(2019, 4, 10, 15, 20,
  %50, 527925), 'updated_at': None}]

This adds more information to the command help and adds a warning
message when duplicate host mappings are detected with guidance about
how to run the command. The command will return 2 if a duplicate host
mapping is encountered and the documentation is updated to explain
this.

This also adds a warning to the scheduler periodic task to recommend
enabling the periodic on only one scheduler to prevent collisions.

We choose to warn and stop instead of ignoring DBDuplicateEntry because
there could potentially be a large number of parallel tasks competing
to insert duplicate records where only one can succeed. If we ignore
and continue to the next record, the large number of tasks will
repeatedly collide in a tight loop until all get through the entire
list of compute hosts that are being mapped. So we instead stop the
colliding task and emit a message.

Closes-Bug: #1824445

Change-Id: Ia7718ce099294e94309103feb9cc2397ff8f5188
2019-06-13 17:18:16 +00:00
..
__init__.py Eventlet monkey patching should be as early as possible 2019-03-22 09:27:16 +00:00
api.py Remove deprecated monkey_patch config options 2018-05-16 11:40:41 -04:00
api_metadata.py Remove deprecated monkey_patch config options 2018-05-16 11:40:41 -04:00
api_os_compute.py Remove deprecated monkey_patch config options 2018-05-16 11:40:41 -04:00
baseproxy.py Convert websocketproxy to use db for token validation 2018-05-03 09:57:56 -04:00
common.py Pass kwargs to exception to get better format of error message 2019-03-15 10:42:18 +08:00
compute.py Remove deprecated monkey_patch config options 2018-05-16 11:40:41 -04:00
conductor.py Remove deprecated monkey_patch config options 2018-05-16 11:40:41 -04:00
console.py Deprecate the nova-console service 2018-10-15 10:03:08 +01:00
consoleauth.py Deprecate the nova-consoleauth service 2018-05-03 10:02:29 -04:00
dhcpbridge.py Remove translation of log messages 2017-06-09 09:06:16 +00:00
manage.py Warn for duplicate host mappings during discover_hosts 2019-06-13 17:18:16 +00:00
network.py conf: Remove cells v1 options, group 2019-05-29 17:14:13 +01:00
novncproxy.py console: Provide an RFB security proxy implementation 2018-01-12 10:00:42 +00:00
policy.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
scheduler.py Remove deprecated monkey_patch config options 2018-05-16 11:40:41 -04:00
serialproxy.py config options: centralize section "serial_console" 2015-11-19 11:00:20 +01:00
spicehtml5proxy.py config options: centralize 'spice' options 2016-04-11 10:34:05 +00:00
status.py Add nova-status upgrade check for minimum required cinder API version 2019-05-03 11:53:12 -04:00
xvpvncproxy.py Pass config object to oslo_reports 2017-09-05 10:39:43 +00:00