]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Record and log reason for dhcp agent resync
authorIan Wienand <iwienand@redhat.com>
Tue, 18 Mar 2014 05:04:49 +0000 (16:04 +1100)
committerIan Wienand <iwienand@redhat.com>
Tue, 6 May 2014 04:44:43 +0000 (14:44 +1000)
commit77ddd463bd2e96041c0b6ecea1c46c4ac4d55851
treeab222fa5f410acd9eeec45851206b7ee8e598e8d
parentae3e92fe0c820dd851ada8fbac50ade068a07e7a
Record and log reason for dhcp agent resync

A dhcp resync can be triggered at a number of points, but the actual
resync is done asynchronously by a helper thread.  This means by the
time the resync happens, it's hard to establish what actually caused
it.

There have been a number of problems in production systems that cause
excessive resyncs.  One is a ipv6/dnsmasq issue (rhbz#1077487) and
another is db corruption with duplicate entries [1].  The resync
triggers a whole lot of logs itself, so it becomes very unclear how to
establish any causality.

This change keeps track of what triggered the resync with some helpful
information.  We add a schedule_resync() function to to replace a
explicit set of needs_resync which tracks why it was called.

[1] The logs will contain output like "DBDuplicateEntry
(IntegrityError) (1062, "Duplicate entry
'6d799c6a-7a09-4c1e-bb63-7d30fd052c8a-d3e3ac5b-9962-428a-a9f8-6b2' for
key 'PRIMARY'") ..." in this case

Closes-Bug: #1294445
Change-Id: I9b1c6202f5a6bbad8589a8b64b2a38c9d9edb43b
neutron/agent/dhcp_agent.py
neutron/tests/unit/test_dhcp_agent.py