BUG 2676 : Apply backpressure when creating transactions 70/14870/11
authorMoiz Raja <moraja@cisco.com>
Thu, 5 Feb 2015 02:19:14 +0000 (18:19 -0800)
committerMoiz Raja <moraja@cisco.com>
Wed, 11 Feb 2015 18:50:13 +0000 (10:50 -0800)
commit2a01b2263488748bd07d224a01b23f5550274447
tree2a66a83e53bc89dd81ef66bbb3503b763f6d6279
parent26b333ab642abbdda8ef0e3b570083b47af00255
BUG 2676 : Apply backpressure when creating transactions

This patch uses a rate limiter to limit the number of write transactions
that can be created on the datastore at any given point of time (within a
second).

We also have added a metric that is trackable using JMX which will show
exactly how much time we take in committing a transaction.

Could this rate limiter have been on the DataBroker? Yes it could have been
but I think we need to go granular on this one. Ideally the ratelimiter would
be for every shard transaction but it's not trivial to do in a way that would
actually block the consumer for now - this is because creating a transaction on
Shard itself is an async operation.

Change-Id: I3d8e3baeb892ba494c0ab0d13a0d6226c1516511
Signed-off-by: Moiz Raja <moraja@cisco.com>
12 files changed:
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedConfigDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java