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)
Reviewed: https:/ /review. opencontrail. org/37029 github. com/Juniper/ contrail- controller/ commit/ 6b0344ab7c15d8a dd563be4df8cae7 df7ba8b75f
Committed: http://
Submitter: Zuul (<email address hidden>)
Branch: master
commit 6b0344ab7c15d8a dd563be4df8cae7 df7ba8b75f
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: I3948ffa2249722 6241ccbfd6708fe 2d8989fa8c2 4d280587a2fb479 bffca5c944)
Closes-Bug: #1721416
(cherry picked from commit 588c8d6752cb7b8