Comment 53 for bug 1721416

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/38825
Committed: http://github.com/Juniper/contrail-controller/commit/a576c184fab8e5df670836e8fe1fcc731f71f6d8
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit a576c184fab8e5df670836e8fe1fcc731f71f6d8
Author: Megh Bhatt <email address hidden>
Date: Fri Oct 27 11:48:03 2017 -0700

Fix concurrent analytics schema creation

Cassandra does not support concurrent schema creation from multiple
clients and hence contrail-collector uses zookeeper to allow only
one contrail-collector to create the schema. However in case of
multiple nodes, the CQL driver is given all the nodes and hence
it is possible that still the schema creation happens on different
nodes. Further it was observed that even when cassandra returns
failure on schema creation the node still creates the schema and this
causes issues on retry since the retry can happen on another node.

The fix is to create a schema session that only connects to the
first cassandra node given to contrail-collector with the assumption
that all contrail-collectors have the same configuration of cassandra.
This is achieved using the whitelist filtering provided by the CQL
driver. Once the schema is created, we will move to using the regular
session for queries.

Change-Id: I3948ffa22497226241ccbfd6708fe2d8989fa8c2
Closes-Bug: #1721416
(cherry picked from commit 588c8d6752cb7b84d280587a2fb479bffca5c944)