Provide multiple datacenters to Cassandra Schema generation scripts #2618
Description
Requirement - what kind of business use case are you trying to solve?
We have a multi-datacenter configuration. Currently, when using the jaeger-cassandra-schema
container, the keyspace being generated can only be configured using 1) a single datacenter; 2) a hard-coded replication factor of 2.
Example of current: {'class': 'NetworkTopologyStrategy', 'dc1': '2' }
This results in the following error:
panic: first replica is not the primary replica for the token: expected 10.120.42.3 got 10.121.4.7
Our Cassandra DBEs propose that the NetworkTopologyStrategy have a minimum replication factor of 3, and that each datacenter be configured during keyspace creation.
Example of requested: {'class': 'NetworkTopologyStrategy', 'dc1': '3', 'dc2': '3' }
Problem - what in Jaeger blocks you from solving the requirement?
We currently use the Jaeger Operator and the CassandraSchema container to prep and manage our Jaeger deployment. Without this change, we need to fork the repo and build our own CassandraSchema container in order to successfully deploy to a multi-dc Cassandra. This would also require us to internally maintain a fork in order to recreate the containers, if need be.
Proposal - what do you suggest to solve the problem or improve the existing situation?
A suggestion would be to edit the plugin/storage/cassandra/schema/create|docker.sh
to allow for comma-delimited DATACENTER value to be provided, and created the appropriate replication_factor
value when multiple datacenters are indeed provided.
I have a PR for this ready, and tested against our Cassandra multi-dc configuration, and it works as expected.