jaegertracing / jaeger-openshift

Support for deploying Jaeger into OpenShift
https://jaegertracing.io/
Apache License 2.0
57 stars 37 forks source link

Cassandra schema updates? #79

Closed gregswift closed 6 years ago

gregswift commented 6 years ago

Hi. We just updated to 1.2 of this project... which was super easy btw :D As we updated things we also updated the job to the 1.2 version. The job ran again and got this output:

Warning: Cannot create directory at `/.cassandra`. Command history will not be saved.
system_schema  system              system_traces
system_auth    system_distributed  jaeger_v1_dc1
Generating the schema for the keyspace jaeger_v1_dc1 and datacenter dc1
Using template file /cassandra-schema/v001.cql.tmpl with parameters:
    mode = prod
    datacenter = dc1
    keyspace = jaeger_v1_dc1
    replication = {'class': 'NetworkTopologyStrategy', 'dc1': '2' }
    trace_ttl = 172800
    dependencies_ttl = 0
Warning: Cannot create directory at `/.cassandra`. Command history will not be saved.
<stdin>:179:InvalidRequest: Error from server: code=2200 [Invalid query] message="Index dependencies_ts_index_idx_1 is a duplicate of existing index dependencies_ts_index_idx"

Generally things seem to be fine so I dont see this as currently beign a problem. But we figured we'd bring it up since schema changing might happen in the future.

Steps we followed to update:

oc project jaeger-test
oc patch deploy jaeger-query -p '{"spec":{"template":{"spec":{"containers":[{"name": "jaeger-query", "image":"jaegertracing/jaeger-query:1.2"}]}}}}'
oc patch deploy jaeger-collector -p '{"spec":{"template":{"spec":{"containers":[{"name": "jaeger-collector", "image":"jaegertracing/jaeger-collector:1.2"}]}}}}'
oc delete jobs jaeger-cassandra-schema-job
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/48478dc068ce18f252404bc62e17b3c53d695786/production/cassandra.yml
jpkrohling commented 6 years ago

Looks like it's only a matter of changing the last CREATE CUSTOM INDEX to CREATE CUSTOM INDEX IF NOT EXISTS

Schema updates should be supported, it just so happens that we had none yet, so, there's only the v001.sql file.

jpkrohling commented 6 years ago

By the way, would you be willing to contribute with a PR?

gregswift commented 6 years ago

There ya go