C3POStorageManager process a transaction with Storage.

Provides a Storage implementaion of the C3PODatamanager service. It
receives a transaction of operations on external (most-likely Neutron)
models, translates them into equivalent MidoNet model operations, and
persist them with the Storage service.

C3PODataManager also needs to track of the past processed C3POTask ID.
The patch introduced a new StorageManagerState Protobuf message, which
is just a container message for holding a last processed task ID. This
information is stored in Storage and maintained (updated) with a
PersistentOp appended at the end of each multi() operation passed to
Storage.

NOTE: flushTopology is to be implemented by a separate patch.
Fix MN-2999

Change-Id: I28a5f8b59c49fa138c3abddef5632cce98af5795
Fix NeutronDeserializerTest

IPv6Addr always serializes in long form, so tests need to expect that.

Change-Id: I3cbcd603a38352d78703515771caa6f4d8c80596
Signed-off-by: Brandon Berg <bberg@midokura.com>
Merge "C3POStorageManager process a transaction with Storage."
Merge "Fix NeutronDeserializerTest"
Disables the subscription tests in ZOOMTests.

We found that testSubscribeWithGc and testSubscribeAllWithGc have some
race conditions, which may result in a thread waiting forever to be
waken up thus the Jenkins job getting stuck and timing out. We figured
out one race situation, but have been unable to provide a complete
solution. This patch disables the culprit tests till we have the
complete solution.

Change-Id: Id81de0f46fd1c248497a876ac229e0bcf17a2f09
ZOOM implements flush as version bumping.

This patch implements flush for ZOOM as data path version bump. The
data path node for class, for example, Bridge will be in the form of,

[BASE_PATH_PREFIX]/[VERSION_#]/Bridge

where base_path_prefix is the path prefix string specified on ZOOM
construction, and VERSION_# is monotonically incremented data path
version number, initially starting from 1.

A new ZOOM instance checks for the version number upon getting built.
If it finds one, it sets its data set version number to the found
value so that a new instance would be able to take over where the
previous ZOOM instance left off. In addition, upon initialization a
ZOOM sets a watcher to the version number node and it'd be notified
if another ZOOM instances bumps the version number to switch to the
new version.

TODO Garbage-collect class / instance subscription GC upon flush / a
notification of the Storage flushed by another ZOOM instance.

Fix MN-2999

Change-Id: Ibd5892a74ce5edb2c8b5f7542d78b6e7af328e6d
Handle NoNode error from create Op in ZkOpList

Handle the case where NoNode exception is thrown because a path
is created or updated after it's deleted.  ZkOpList in that case
massages the internal data structures that store the Op objects
so that NoNode exception would not be thrown.

Change-Id: Ic0cf3e7f011478cd6b906598a062c1305b6ea70e
Fixes: MNA-2
Perf tests: fix source directory detection

Change-Id: Iea1c80856214dda22112dc8844139b157fa6f5ed
Signed-off-by: Duarte Nunes <duarte@midokura.com>
DatapathController.: move port resolution to host proxy

Move port resolution to HostRequestProxy, so that all event
handling in the datapath controller is not liable to non
existent ports or request timeouts, making it easier to
linearize operaitons and handle requets retries.

The HostRequestProxy will resolve ports into a new ResolvedHost
object. Ports that error out are filtered out. But, if any of them
does, a fresh request (unsubscribe/resubscribe) is sent to the VTPM,
which translates into a natural retry loop that doesn't mess with
the DatapathController event handling.

Change-Id: I9d1c0eedf48949ac9f689ecb4dd6ea950f728b81
Fixes: MN-2950
Signed-off-by: Guillermo Ontanon <guillermo@midokura.jp>
Merge "Handle NoNode error from create Op in ZkOpList"
Merge "Perf tests: fix source directory detection"
Merge "DatapathController.: move port resolution to host proxy"
Support numerical protocol value for RuleProtocol

To be compatible with Neutron, support both the numerical and
string values as an input to represent the security group rule's
protocol.

Change-Id: I57c06f1c02972f73ab61272df6443f801e62fa82
Fixes: MNA-21
Fixes HTB bug causing excess tokens to appear

This patch fixes a bug in HTB whereby a variable tracking the current
number of token wasn't appropriately updated under some circumstances.

Change-Id: Iecc2c30765b327748515b7df837e2c395e138d64
Signed-off-by: Duarte Nunes <duarte@midokura.com>
Merge "Fixes HTB bug causing excess tokens to appear"
Unify netty dependencies to version 4.0.24.Final

Update netty dependencies to version 4.0.24,
remove obsolete version netty dependency from ovsdb
and brain subprojects, introduce infinispan dependency
in midonet-utils for functionality that no longer
belongs to netty.

Change-Id: I743266da14ce5c6cab6ac51f5cccd50d8f4f9390
Signed-off-by: Ernest Artiaga <ernest@midokura.com>
Fix GC problems in ZookeeperObjectMapperTests

We believe the deadlocks are being caused by startGc()'s notify() call
happening before gcRunnable.run()'s wait() call. This change adds a sentinel
that should prevent a deadlock in that situation (thanks for fixing this
Brandon). This patch also ensures that the GC thread gets unblocked after
every test by calling startGc and waitForGc in the suite teardown.

Change-Id: Ida3bac6af6bfeb29a62f3392bc44b2201dad513b
Signed-off-by: Nicolas Schiper <nicolas@midokura.com>
Merge "Unify netty dependencies to version 4.0.24.Final"
Removes a print debug statement left behind.

Change-Id: I696145d8ce75f9911b77eff68c718d2c6b208f97
Topology API protocol messages

Protobuf definitions related to the read-only Topology API service.

Ref: MN-2985

Change-Id: I44abdc59822f09d8602aec4fe0488f79fe7a7b0f
Signed-off-by: Ernest Artiaga <ernest@midokura.com>